Esempio n. 1
0
 /**
  * WPZOOM custom menu for wp-admin
  */
 public static function register_admin_pages()
 {
     add_object_page('Page Title', 'WPZOOM', 'manage_options', 'wpzoom_options', 'WPZOOM_Admin::admin', WPZOOM::$assetsPath . '/images/shortcode-icon.png');
     add_submenu_page('wpzoom_options', 'WPZOOM', 'Theme Options', 'manage_options', 'wpzoom_options', array(__CLASS__, 'admin'));
     if (option::is_on('framework_update_enable')) {
         add_submenu_page('wpzoom_options', 'Update Framework', 'Update Framework', 'update_themes', 'wpzoom_update', array(__CLASS__, 'update'));
     }
     if (option::is_on('framework_newthemes_enable') && !wpzoom::$tf) {
         add_submenu_page('wpzoom_options', 'New Themes', 'New Themes', 'manage_options', 'wpzoom_themes', array(__CLASS__, 'themes'));
     }
 }
Esempio n. 2
0
 public static function init()
 {
     if (option::is_on('framework_update_enable') && option::is_on('framework_update_notification_enable')) {
         add_action('admin_head', array('WPZOOM_Framework_Updater', 'update_init'));
         add_action('admin_head', array('WPZOOM_Framework_Updater', 'check_update'));
     }
     if (option::is_on('framework_theme_update_notification_enable') && !wpzoom::$tf) {
         add_action('admin_head', array('WPZOOM_Theme_Updater', 'check_update'));
     }
     add_action('wp_ajax_wpzoom_updater', array(__CLASS__, 'ajax'));
 }
Esempio n. 3
0
 public static function init()
 {
     add_action('after_setup_theme', array(__CLASS__, 'add_feed_links'));
     if (option::is_on("meta_generator")) {
         add_action('wp_head', array(__CLASS__, 'meta_generator'));
     }
     add_action('wp_title', array(__CLASS__, 'wp_title'), 10, 2);
     add_action('wp_head', array(__CLASS__, 'favicon'));
     add_action('wp_head', array(__CLASS__, 'generate_options_css'));
     add_action('wp_head', array(__CLASS__, 'header_code'));
     add_action('wp_enqueue_scripts', array(__CLASS__, 'theme_styles'), 20);
     add_action('wp_enqueue_scripts', array(__CLASS__, 'theme_scripts'));
     add_action('wp_footer', array(__CLASS__, 'footer_code'));
 }
Esempio n. 4
0
 /**
  * Generates CSS to preview Typography Fonts families
  *
  * @return void
  */
 public static function fonts_families_preview()
 {
     if (!option::is_on('framework_fonts_preview')) {
         return;
     }
     $css = '';
     $fonts = '';
     $font_families = ui::recognized_font_families();
     $google_font_families = ui::recognized_google_webfonts_families();
     foreach ($font_families as $slug => $font) {
         $css .= '.selectBox-dropdown-menu a[rel=' . $slug . ']{font-family:' . $font . ';}';
     }
     foreach ($google_font_families as $font) {
         if (isset($font['separator'])) {
             continue;
         }
         $slug = str_replace(' ', '-', strtolower($font['name']));
         $css .= '.selectBox-dropdown-menu a[rel=' . $slug . ']{font-family:' . $font['name'] . ';}';
         $fonts .= $font['name'] . '|';
     }
     $fonts = str_replace(" ", "+", $fonts);
     $google_css = '@import url("http' . (is_ssl() ? 's' : '') . '://fonts.googleapis.com/css?family=' . $fonts . "\");\n";
     $google_css = str_replace('|"', '"', $google_css);
     echo '<style type="text/css">';
     echo $google_css;
     echo $css;
     echo '</style>';
 }
 /**
  * Add Theme Options to Admin Bar
  *
  * @param WP_Admin_Bar $wp_admin_bar
  */
 public static function add_node_to_admin_bar($wp_admin_bar)
 {
     if (!is_super_admin() || !is_admin_bar_showing()) {
         return;
     }
     $wp_admin_bar->add_menu(array('id' => 'wpzoom', 'title' => __('WPZOOM', 'wpzoom'), 'href' => admin_url('admin.php?page=wpzoom_options')));
     $wp_admin_bar->add_menu(array('id' => 'wpzoom-theme-options', 'parent' => 'wpzoom', 'title' => __('Theme Options', 'wpzoom'), 'href' => admin_url('admin.php?page=wpzoom_options')));
     if (option::is_on('framework_update_enable')) {
         $wp_admin_bar->add_menu(array('id' => 'wpzoom-framework-update', 'parent' => 'wpzoom', 'title' => __('Framework Update', 'wpzoom'), 'href' => admin_url('admin.php?page=wpzoom_update')));
     }
 }
Esempio n. 6
0
 public function seo_notification()
 {
     if (!option::is_on('seo_enable')) {
         return;
     }
     // don't show notification if seo is disabled
     if (option::get('framework_seo_aware')) {
         return;
     }
     // don't show notification if it was hidden
     if (WPZOOM::$theme_raw_name == 'angle') {
         return;
     }
     // don't show notification for new themes
     if (WPZOOM::$theme_raw_name == 'compass') {
         return;
     }
     // don't show notification for new themes
     if (!current_user_can('install_plugins')) {
         return;
     }
     // don't show notification if current user can't install plugins
     echo '<div class="zoomfw-seo update-nag">';
     echo '<p>';
     echo __('WPZOOM SEO Settings are deprecated and will be removed in the next ZOOM Framework update. ', 'wpzoom');
     echo sprintf(__('You can disable WPZOOM SEO from <a href="%s">Theme Options</a>.', 'wpzoom'), esc_url(admin_url('admin.php?page=wpzoom_options')));
     echo '</p>';
     if (is_multisite()) {
         echo sprintf('<p>%s</p>', __('In case you are using our themes on a multisite install don\'t forget to notify your users about this change.', 'wpzoom'));
     }
     echo sprintf('<p>%s</p>', __('Recommended SEO Plugin is <a href="http://wordpress.org/plugins/wordpress-seo/">WordPress SEO by Yoast</a>.', 'wpzoom'));
     echo '<input type="button" class="close button" value="Hide" /></div>';
 }
 /**
  * Handles SEO Options
  */
 public static function seo()
 {
     global $post;
     if (option::is_on('seo_enable')) {
         if (is_singular()) {
             if ($post->post_excerpt !== '') {
                 $description = $post->post_excerpt;
             } else {
                 $content = str_replace(']]>', ']]&gt;', $post->post_content);
                 $content = preg_replace('|\\[(.+?)\\](.+?\\[/\\1\\])?|s', '', $content);
                 $content = strip_tags($content);
                 $description = strlen($content) < 155 ? $content : substr($content, 0, strpos($content, " ", 155));
             }
             echo '<meta name="description" content="' . esc_attr(strip_tags(stripslashes($description))) . '" />' . "\n";
             self::metaPostKeywords();
         } elseif (is_home()) {
             echo '<meta name="description" content="' . self::description() . '" />' . "\n";
             self::metaHomeKeywords();
         }
         self::index();
     }
 }
/* Video API */
require_once WPZOOM_INC . "/components/video-api.php";
if (is_admin()) {
    require_once WPZOOM_INC . "/components/video-thumb.php";
}
/* Load get the image file only when it's not installed as a plugin */
if (!function_exists('get_the_image')) {
    require_once WPZOOM_INC . "/components/get-the-image.php";
}
/* Require shortcodes */
if (option::is_on('framework_shortcodes_enable')) {
    require_once WPZOOM_INC . "/components/shortcodes/shortcodes.php";
    require_once WPZOOM_INC . "/components/shortcodes/init.php";
}
/* wzslider */
if (option::is_on('framework_wzslider_enable')) {
    require_once WPZOOM_INC . "/components/shortcodes/wzslider.php";
}
require_once WPZOOM_INC . "/components/theme/ui.php";
if (!is_admin()) {
    require_once WPZOOM_INC . "/components/theme/theme.php";
    WPZOOM_Theme::init();
}
/**
 * Delay `zoom_load_components` function to run after `functions.php` file is
 * executed. This is needed because we load components code iff somewhere is
 * stated that this theme supports a zoom component via `add_theme_support`.
 *
 * In `functions.php` and other code loaded directly by this file we need to
 * wrap access to option values (option::get) into functions that run in
 * `after_setup_theme` action with priority higher than 10, otherwise it will
Esempio n. 9
0
                <?php 
if (!get_theme_mod('hide-tagline')) {
    ?>
                    <p class="tagline"><?php 
    bloginfo('description');
    ?>
</p>
                <?php 
}
?>

            </div><!-- .navbar-brand -->


            <?php 
if (option::is_on('ad_head_select')) {
    ?>
                <div class="adv">

                    <?php 
    if (option::get('ad_head_code') != "") {
        echo stripslashes(option::get('ad_head_code'));
    } else {
        ?>
                        <a href="<?php 
        echo option::get('banner_top_url');
        ?>
"><img src="<?php 
        echo option::get('banner_top');
        ?>
" alt="<?php 
Esempio n. 10
0
function carouFredSel_scripts()
{
    if (!is_home()) {
        return;
    }
    if (get_query_var('paged') && get_query_var('paged') != 1) {
        return;
    }
    if (!option::is_on('featured_posts_show')) {
        return;
    }
    $slider_config = array('slideshow_speed' => intval(option::get('slideshow_speed')), 'autoplay' => option::is_on('slideshow_auto'));
    if (option::is_on('slideshow_auto')) {
        wp_enqueue_script('frogaloop', 'http://a.vimeocdn.com/js/froogaloop2.min.js');
        wp_enqueue_script('youtube-player-api', 'https://www.youtube.com/player_api');
    }
    wp_enqueue_script('touchswipe', get_template_directory_uri() . '/js/jquery.touchSwipe.min.js', array('jquery'), '1.6.5', true);
    wp_enqueue_script('caroufredsel', get_template_directory_uri() . '/js/jquery.carouFredSel.js', array('jquery'), '6.2.1', true);
    wp_enqueue_script('featured-slider', get_template_directory_uri() . '/js/jquery.featuredSlider.js', array('touchswipe', 'caroufredsel'), '20140127', true);
    wp_localize_script('featured-slider', 'featured_slider', json_encode($slider_config));
}
Esempio n. 11
0
 /**
  * WPZOOM custom menu for wp-admin
  */
 public function register_admin_pages()
 {
     add_object_page('Page Title', 'WPZOOM', 'manage_options', 'wpzoom_options', array($this, 'admin'), 'none');
     add_submenu_page('wpzoom_options', 'WPZOOM', 'Theme Options', 'manage_options', 'wpzoom_options', array($this, 'admin'));
     if (file_exists(get_template_directory() . '/functions/customizer')) {
         $customize_url = add_query_arg('return', urlencode(wp_unslash($_SERVER['REQUEST_URI'])), 'customize.php');
         add_submenu_page('wpzoom_options', 'Customize', 'Customize', 'customize', esc_url($customize_url));
     }
     if (option::is_on('framework_update_enable')) {
         add_submenu_page('wpzoom_options', 'Update Framework', 'Update Framework', 'update_themes', 'wpzoom_update', array($this, 'update'));
     }
     if (option::is_on('framework_newthemes_enable') && !wpzoom::$tf) {
         add_submenu_page('wpzoom_options', 'New Themes', 'New Themes', 'manage_options', 'wpzoom_themes', array($this, 'themes'));
     }
 }
Esempio n. 12
0
<?php

get_header();
$paged = get_query_var('paged') ? get_query_var('paged') : 1;
// gets current page number
?>

<?php 
if (is_home() && $paged < 2 && option::is_on('featured_top_display')) {
    get_template_part('wpzoom-featured');
    // Display 4 Featured Posts at the Top
    if (option::get('ad_top_select') == 'on') {
        // Homepage Top Ad
        ?>

		<div class="adv_top">
		<?php 
        if (option::get('ad_top_code') != "") {
            echo stripslashes(option::get('ad_top_code'));
        } else {
            ?>
<a href="<?php 
            echo option::get('banner_top_home_url');
            ?>
"><img src="<?php 
            echo option::get('banner_top_home');
            ?>
" alt="<?php 
            echo option::get('banner_top_home_alt');
            ?>
" /></a><?php