コード例 #1
0
 function wpex_blog_exclude_categories()
 {
     // Wait..we don't want to be in these plages? Lets leave now!
     if (is_admin()) {
         return;
     }
     if (is_search()) {
         return;
     }
     if (is_archive()) {
         return;
     }
     // Categories to exclude
     $cats_to_exclude = wpex_option('blog_cats_exclude');
     // Admin option is blank, so bail.
     if ($cats_to_exclude == '') {
         return;
     }
     // Blog template
     if (is_home() && !is_singular('page')) {
         $exclude = $cats_to_exclude;
     } else {
         return;
         // Do nothing, ok?
     }
     if ($cats_to_exclude) {
         set_query_var('category__not_in', $cats_to_exclude);
     }
 }
コード例 #2
0
/**
 * Orbis company subscriptions
 */
function orbis_subscriptions_render_company_subscriptions()
{
    if (is_singular('orbis_company')) {
        global $orbis_subscriptions_plugin;
        $orbis_subscriptions_plugin->plugin_include('templates/company-subscriptions.php');
    }
}
コード例 #3
0
 /**
  * get the current page ID.
  *
  * @return  int the current page ID.
  */
 public function page_id()
 {
     global $post;
     if (isset($post)) {
         /**
          * Get the current post ID
          */
         $id = $post->ID;
         /**
          * If we're on the posts page, get the ID of the page
          * using the 'page_for_posts' option.
          */
         if (is_home()) {
             $id = get_option('page_for_posts');
         } else {
             /**
              * I we're on the WooCommerce shop page, get the ID of the page
              * using the 'woocommerce_shop_page_id' option
              */
             if (function_exists('is_shop') && is_shop()) {
                 $id = get_option('woocommerce_shop_page_id');
             } else {
                 /**
                  * If this is a  singular page/post then set ID to the page ID.
                  * If not, then set it to false.
                  */
                 $id = is_singular() ? $post->ID : false;
             }
         }
     } else {
         $id = false;
     }
     return $id;
 }
コード例 #4
0
ファイル: page-title.php プロジェクト: booklein/wpbookle
function porto_page_title()
{
    global $porto_settings;
    $output = '';
    if (!is_front_page()) {
    } elseif (is_home()) {
        $output .= $porto_settings['blog-title'];
    }
    if (is_singular()) {
        $output .= porto_page_title_leaf();
    } else {
        if (is_post_type_archive()) {
            if (is_search()) {
                $output .= porto_page_title_leaf('search');
            } else {
                $output .= porto_page_title_archive();
            }
        } elseif (is_tax() || is_tag() || is_category()) {
            $html = porto_page_title_leaf('term');
            if (is_tag()) {
                $output .= sprintf(__('Tag - %s', 'porto'), $html);
            } elseif (is_tax('product_tag')) {
                $output .= sprintf(__('Product Tag - %s', 'porto'), $html);
            } else {
                $output .= $html;
            }
        } elseif (is_date()) {
            if (is_year()) {
                $output .= porto_page_title_leaf('year');
            } elseif (is_month()) {
                $output .= porto_page_title_leaf('month');
            } elseif (is_day()) {
                $output .= porto_page_title_leaf('day');
            }
        } elseif (is_author()) {
            $output .= porto_page_title_leaf('author');
        } elseif (is_search()) {
            $output .= porto_page_title_leaf('search');
        } elseif (is_404()) {
            $output .= porto_page_title_leaf('404');
        } elseif (class_exists('bbPress') && is_bbpress()) {
            if (bbp_is_search()) {
                $output .= porto_page_title_leaf('bbpress_search');
            } elseif (bbp_is_single_user()) {
                $output .= porto_page_title_leaf('bbpress_user');
            } else {
                $output .= porto_page_title_leaf();
            }
        } else {
            if (is_home() && !is_front_page()) {
                if (get_option('show_on_front') == 'page') {
                    $output .= get_the_title(get_option('page_for_posts', true));
                } else {
                    $output .= $porto_settings['blog-title'];
                }
            }
        }
    }
    return apply_filters('porto_page_title', $output);
}
コード例 #5
0
ファイル: enqueue.php プロジェクト: derk153/diamescort
/**
 * understrap enqueue scripts
 *
 * @package understrap
 */
function understrap_scripts()
{
    // wp_enqueue_style( 'understrap-theme', get_stylesheet_directory_uri() . '/css/theme.min.css', array(), '0.2.8', false );
    wp_enqueue_style('understrap-theme', get_stylesheet_directory_uri() . '/css/theme.css', array(), '0.2.8', false);
    // wp_enqueue_script('jquery');
    wp_enqueue_script('jquery', get_template_directory_uri() . '/js/jquery.js', array(), '2.1.4', false);
    wp_enqueue_script('understrap-navigation', get_template_directory_uri() . '/js/bootstrap.min.js', array(), '20120206', true);
    wp_enqueue_script('understrap-skip-link-focus-fix', get_template_directory_uri() . '/js/skip-link-focus-fix.js', array(), '20130115', true);
    // angular relations
    wp_enqueue_script('angular', get_template_directory_uri() . '/js/angular.js', array(), '1.4.9', true);
    wp_enqueue_script('angular-ui-router', '//cdnjs.cloudflare.com/ajax/libs/angular-ui-router/0.2.17/angular-ui-router.min.js', array(), '0.2.17', true);
    wp_enqueue_script('angular-animate', '//ajax.googleapis.com/ajax/libs/angularjs/1.4.9/angular-animate.js', array(), '1.4.9', true);
    wp_enqueue_script('angular-sanitize', '//ajax.googleapis.com/ajax/libs/angularjs/1.4.9/angular-sanitize.min.js', array(), '1.4.9', true);
    wp_enqueue_script('ui-bootstrap', '//angular-ui.github.io/bootstrap/ui-bootstrap-tpls-1.1.2.js', array(), '1.1.2', true);
    // Angualr APP
    wp_enqueue_script('app', get_template_directory_uri() . '/js/app.js', array(), null, true);
    // Custom JS
    wp_enqueue_script('script', get_template_directory_uri() . '/js/script.js', array(), null, true);
    // NON SASS CSS
    wp_enqueue_style('animate', get_stylesheet_directory_uri() . '/css/animate.css', array(), '0.2.8', false);
    if (is_singular() && comments_open() && get_option('thread_comments')) {
        wp_enqueue_script('comment-reply');
    }
    if (is_active_sidebar('hero')) {
        wp_enqueue_style('understrap-carousel-style', get_template_directory_uri() . '/css/owl.carousel.css', array(), '20024', false);
        wp_enqueue_script('understrap-carousel-script', get_template_directory_uri() . '/js/owl.carousel.min.js', array(), '20024', true);
    }
}
コード例 #6
0
/**
 * Enqueue scripts
 */
function mb_scripts()
{
    wp_enqueue_style('_mbbasetheme-style', get_stylesheet_uri());
    if (is_singular() && comments_open() && get_option('thread_comments')) {
        wp_enqueue_script('comment-reply');
    }
}
コード例 #7
0
 function post_availability($content)
 {
     $out = '';
     if (is_singular()) {
         $languages = icl_get_languages('skip_missing=true');
         if (1 < count($languages)) {
             //$out .= $this->settings['post_available_before'] ? $this->settings['post_available_before'] : '';
             foreach ($languages as $l) {
                 if (!$l['active']) {
                     $langs[] = '<a href="' . apply_filters('WPML_filter_link', $l['url'], $l) . '">' . $l['translated_name'] . '</a>';
                 }
             }
             $out .= join(', ', $langs);
             //$out .= $this->settings['post_available_after'] ? $this->settings['post_available_after'] : '';
             if (!function_exists('icl_t')) {
                 function icl_t($c, $n, $str)
                 {
                     return $str;
                 }
             }
             $out = '<p class="icl_post_in_other_langs">' . sprintf(icl_t('WPML', 'Text for alternative languages for posts', $this->settings['icl_post_availability_text']), $out) . '</p>';
         }
     }
     if ($this->settings['icl_post_availability_position'] == 'above') {
         return $out . $content;
     } else {
         return $content . $out;
     }
 }
コード例 #8
0
function bones_scripts_and_styles()
{
    global $wp_styles;
    // call global $wp_styles variable to add conditional wrapper around ie stylesheet the WordPress way
    if (!is_admin()) {
        // modernizr and main stylesheets
        wp_register_script('bones-modernizr', get_stylesheet_directory_uri() . '/assets/js/libs/modernizr.custom.min.js', array(), '2.5.3', false);
        wp_register_style('bones-stylesheet', get_stylesheet_directory_uri() . '/assets/css/style.min.css', array(), '', 'all');
        wp_register_style('bones-owlcarousel-css', get_stylesheet_directory_uri() . '/assets/vendor/owl.carousel/dist/assets/owl.carousel.min.css', array(), '', 'all');
        wp_register_style('bones-owlcarousel-theme', get_stylesheet_directory_uri() . '/assets/vendor/owl.carousel/dist/assets/owl.theme.default.min.css', array(), '', 'all');
        wp_register_style('bones-ie-only', get_stylesheet_directory_uri() . '/assets/css/ie.min.css', array(), '');
        // comment reply script for threaded comments
        if (is_singular() and comments_open() and get_option('thread_comments') == 1) {
            wp_enqueue_script('comment-reply');
        }
        //adding scripts file in the footer
        wp_register_script('bones-js', get_stylesheet_directory_uri() . '/assets/js/scripts.js', array('jquery'), '', true);
        wp_register_script('bones-quickshare', get_stylesheet_directory_uri() . '/assets/vendor/quickshare/dist/quickshare.min.js', array('jquery'), '', true);
        wp_register_script('bones-owlcarousel-js', get_stylesheet_directory_uri() . '/assets/vendor/owl.carousel/dist/owl.carousel.min.js', array('jquery'), '', true);
        wp_enqueue_script('bones-modernizr');
        wp_enqueue_style('bones-stylesheet');
        wp_enqueue_style('bones-owlcarousel-css');
        wp_enqueue_style('bones-owlcarousel-theme');
        wp_enqueue_style('bones-ie-only');
        $wp_styles->add_data('bones-ie-only', 'conditional', 'lt IE 9');
        // add conditional wrapper around ie stylesheet
        wp_enqueue_script('jquery');
        wp_enqueue_script('bones-js');
        wp_enqueue_script('bones-quickshare');
        wp_enqueue_script('bones-owlcarousel-js');
    }
}
コード例 #9
0
ファイル: define.php プロジェクト: redcypress/lacecake
function javo_lister_redirect_disabled($redirect_url)
{
    if (is_singular('lister')) {
        $redirect_url = false;
    }
    return $redirect_url;
}
コード例 #10
0
function site_scripts()
{
    global $wp_styles;
    // Call global $wp_styles variable to add conditional wrapper around ie stylesheet the WordPress way
    // Removes WP version of jQuery
    wp_deregister_script('jquery');
    // Load jQuery files in header - load in header to avoid issues with plugins
    wp_enqueue_script('jquery', get_template_directory_uri() . '/vendor/jquery/dist/jquery.min.js', array(), '', true);
    // Load What-Input files in footer
    wp_enqueue_script('what-input', get_template_directory_uri() . '/vendor/what-input/what-input.min.js', array(), '', true);
    // Adding Foundation scripts file in the footer
    wp_enqueue_script('foundation-js', get_template_directory_uri() . '/assets/js/foundation.min.js', array('jquery'), '6.0', true);
    // Adding scripts file in the footer
    wp_enqueue_script('site-js', get_template_directory_uri() . '/assets/js/scripts.js', array('jquery'), '', true);
    // Register main stylesheet
    wp_enqueue_style('site-css', get_template_directory_uri() . '/assets/css/style.min.css', array(), '', 'all');
    // Register custom stylesheet
    wp_enqueue_style('dragoncove-css', get_template_directory_uri() . '/assets/css/dragoncove-style.css', array(), '', 'all');
    // Register custom stylesheet
    wp_enqueue_style('dragoncove-woocommerce-css', get_template_directory_uri() . '/assets/css/dragoncove-woocommerce.css', array(), '', 'all');
    // Comment reply script for threaded comments
    if (is_singular() and comments_open() and get_option('thread_comments') == 1) {
        wp_enqueue_script('comment-reply');
    }
}
コード例 #11
0
ファイル: functions.php プロジェクト: iinspiration/theme
function et_vertex_load_scripts_styles()
{
    global $wp_styles;
    $template_dir = get_template_directory_uri();
    if (is_singular() && comments_open() && get_option('thread_comments')) {
        wp_enqueue_script('comment-reply');
    }
    wp_enqueue_script('superfish', $template_dir . '/js/superfish.js', array('jquery'), '1.0', true);
    wp_enqueue_script('waypoints', $template_dir . '/js/waypoints.min.js', array('jquery'), '1.0', true);
    wp_enqueue_script('vertex-custom-script', $template_dir . '/js/custom.js', array('jquery'), '1.0', true);
    wp_localize_script('vertex-custom-script', 'et_custom', array('mobile_nav_text' => esc_html__('Navigation Menu', 'Vertex')));
    $et_gf_enqueue_fonts = array();
    $et_gf_heading_font = sanitize_text_field(et_get_option('heading_font', 'none'));
    $et_gf_body_font = sanitize_text_field(et_get_option('body_font', 'none'));
    if ('none' != $et_gf_heading_font) {
        $et_gf_enqueue_fonts[] = $et_gf_heading_font;
    }
    if ('none' != $et_gf_body_font) {
        $et_gf_enqueue_fonts[] = $et_gf_body_font;
    }
    if (!empty($et_gf_enqueue_fonts)) {
        et_gf_enqueue_fonts($et_gf_enqueue_fonts);
    }
    /*
     * Loads the main stylesheet.
     */
    wp_enqueue_style('vertex-style', get_stylesheet_uri());
}
コード例 #12
0
function orbis_subscription_product_render_details()
{
    if (is_singular('orbis_subs_product')) {
        global $orbis_subscriptions_plugin;
        get_template_part('templates/subscription_product_details');
    }
}
コード例 #13
0
function reactor_numeric_posts_nav()
{
    if (is_singular()) {
        return;
    }
    global $wp_query;
    $paginas = new WP_Query($args);
    $html = '';
    /** Stop execution if there's only 1 page */
    if ($paginas->max_num_pages <= 1) {
        return;
    }
    $paged = get_query_var('paged') ? absint(get_query_var('paged')) : 1;
    $max = intval($paginas->max_num_pages);
    /**	Add current page to the array */
    if ($paged >= 1) {
        $links[] = $paged;
    }
    /**	Add the pages around the current page to the array */
    if ($paged >= 3) {
        $links[] = $paged - 1;
        $links[] = $paged - 2;
    }
    if ($paged + 2 <= $max) {
        $links[] = $paged + 2;
        $links[] = $paged + 1;
    }
    echo '<div class="navigation"><ul>' . "\n";
    /**	Previous Post Link */
    if (get_previous_posts_link()) {
        printf('<li>%s</li>' . "\n", get_previous_posts_link());
    }
    /**	Link to first page, plus ellipses if necessary */
    if (!in_array(1, $links)) {
        $class = 1 == $paged ? ' class="active"' : '';
        printf('<li%s><a href="%s">%s</a></li>' . "\n", $class, esc_url(get_pagenum_link(1)), '1');
        if (!in_array(2, $links)) {
            echo '<li>…</li>';
        }
    }
    /**	Link to current page, plus 2 pages in either direction if necessary */
    sort($links);
    foreach ((array) $links as $link) {
        $class = $paged == $link ? ' class="active"' : '';
        printf('<li%s><a href="%s">%s</a></li>' . "\n", $class, esc_url(get_pagenum_link($link)), $link);
    }
    /**	Link to last page, plus ellipses if necessary */
    if (!in_array($max, $links)) {
        if (!in_array($max - 1, $links)) {
            echo '<li>…</li>' . "\n";
        }
        $class = $paged == $max ? ' class="active"' : '';
        printf('<li%s><a href="%s">%s</a></li>' . "\n", $class, esc_url(get_pagenum_link($max)), $max);
    }
    /**	Next Post Link */
    if (get_next_posts_link()) {
        printf('<li>%s</li>' . "\n", get_next_posts_link());
    }
    echo '</ul></div>' . "\n";
}
コード例 #14
0
ファイル: functions.php プロジェクト: ReConcepts/mashariki
 function kasa_of_register_js()
 {
     wp_enqueue_script('main', esc_url(get_template_directory_uri() . '/js/main.js'), array('jquery'), '1.0', true);
     if (is_singular() && comments_open() && get_option('thread_comments')) {
         wp_enqueue_script('comment-reply');
     }
 }
コード例 #15
0
ファイル: enqueue-scripts.php プロジェクト: stevelolz/dean
function site_scripts()
{
    global $wp_styles;
    // Call global $wp_styles variable to add conditional wrapper around ie stylesheet the WordPress way
    // Load What-Input files in footer
    wp_enqueue_script('what-input', get_template_directory_uri() . '/vendor/what-input/what-input.min.js', array(), '', true);
    // Adding Foundation scripts file in the footer
    wp_enqueue_script('foundation-js', get_template_directory_uri() . '/assets/js/foundation.min.js', array('jquery'), '6.0', true);
    // Adding scripts file in the footer
    wp_enqueue_script('site-js', get_template_directory_uri() . '/assets/js/scripts.js', array('jquery', 'masonry'), '', true);
    // Adding scripts file in the footer
    wp_enqueue_script('slick', get_template_directory_uri() . '/assets/js/slick.min.js', array('jquery'), '', true);
    // Adding imagesLoaded
    wp_enqueue_script('imagesLoaded', get_template_directory_uri() . '/node_modules/imagesloaded/imagesloaded.pkgd.min.js', array('jquery'), '', true);
    // Adding Slick Nav
    wp_enqueue_script('slicknav', get_template_directory_uri() . '/assets/js/slicknav/dist/jquery.slicknav.min.js', array('jquery'), '', true);
    // Smooth Scroll
    wp_enqueue_script('smoscroll', get_template_directory_uri() . '/assets/js/jquery.smooth-scroll.min.js', array("jquery"), '3.3.2', true);
    // Register main stylesheet
    wp_enqueue_style('site-css', get_template_directory_uri() . '/assets/css/style.css', array(), '', 'all');
    // Register main stylesheet
    wp_enqueue_style('slicknav-css', get_template_directory_uri() . '/assets/css/slicknav.css', array(), '', 'all');
    // Register Foundation Icons
    wp_enqueue_style('icons', get_template_directory_uri() . '/assets/css/social_foundicons.css', array(), '', 'all');
    wp_enqueue_style('iconsie7', get_template_directory_uri() . '/assets/css/social_foundicons_ie7.css', array(), '', 'all');
    // Comment reply script for threaded comments
    if (is_singular() and comments_open() and get_option('thread_comments') == 1) {
        wp_enqueue_script('comment-reply');
    }
}
コード例 #16
0
 /**
  * Generate the HTML for this slideshow.
  * @since  1.0.0
  * @return string The generated HTML.
  */
 protected function generate_slideshow($instance)
 {
     if (!is_singular()) {
         return '';
     }
     global $wooslider;
     $settings = $wooslider->settings->get_settings();
     $settings['slider_type'] = $this->slider_type;
     $extra_args = array();
     foreach ($instance as $k => $v) {
         if (!in_array($k, array_keys($settings))) {
             $extra_args[$k] = esc_attr($v);
             unset($instance[$k]);
         }
     }
     // Make sure the various settings are applied.
     if (isset($instance['show_advanced_settings']) && $instance['show_advanced_settings'] == true) {
         foreach ($settings as $k => $v) {
             if (isset($instance[$k]) && $instance[$k] != $settings[$k]) {
                 $settings[$k] = esc_attr($instance[$k]);
             }
         }
     }
     $html = wooslider($settings, $extra_args, false);
     return $html;
 }
コード例 #17
0
 public function widget($args, $instance)
 {
     if (!is_singular()) {
         return;
     }
     $the_id = get_the_ID();
     if (!comments_open($the_id)) {
         return;
     } else {
         $html = $args['before_widget'];
         if (!empty($instance['title'])) {
             $html .= $args['before_title'] . apply_filters('widget_title', $instance['title']) . $args['after_title'];
         }
         $api_url = esc_url(home_url('/')) . 'wp-json/wp/v2/comments';
         $author = __('NAME:', 'rest-api-widgets');
         $mailaddress = __('MAIL:', 'rest-api-widgets');
         $content = __('COMMENTS:', 'rest-api-widgets');
         $send_btn = __('SEND', 'rest-api-widgets');
         $success_text = __('Success! Reload now.', 'rest-api-widgets');
         $fail_text = __('Fail :(', 'rest-api-widgets');
         $html .= "<form action={$api_url} method='post' id='rest-api-widgets-comment'>";
         $html .= '<dl>';
         $html .= "<dt>{$author}</dt><dd><input name='author_name' value=''></dd>";
         $html .= "<dt>{$mailaddress}</dt><dd><input name='author_email' value=''></dd>";
         $html .= "<dt>{$content}</dt><dd><textarea name='content' id=' cols='30' rows='10'></textarea></dd>";
         $html .= '</dl>';
         $html .= "<input type='hidden' name='post' value='{$the_id}'>";
         $html .= "<input type='hidden' name='success_text' value='{$success_text}'>";
         $html .= "<input type='hidden' name='fail_text' value='{$fail_text}'>";
         $html .= "<button>{$send_btn}</button>";
         $html .= '</form>';
     }
     echo $html . $args['after_widget'];
 }
コード例 #18
0
 function condition()
 {
     if (apply_filters('appthemes_disable_order_summary_template', false)) {
         return false;
     }
     return is_singular(APPTHEMES_ORDER_PTYPE);
 }
コード例 #19
0
 function widget($args, $instance)
 {
     global $wp_query;
     extract($args);
     $current_taxonomy = $this->_get_current_taxonomy($instance);
     if (!empty($instance['title'])) {
         $title = $instance['title'];
     } else {
         if ('post_tag' == $current_taxonomy) {
             $title = __('Tags');
         } else {
             $tax = get_taxonomy($current_taxonomy);
             $title = $tax->labels->name;
         }
     }
     $use_desc_for_title = isset($instance['use_desc_for_title']) ? $instance['use_desc_for_title'] : true;
     $count = isset($instance['count']) ? $instance['count'] : false;
     $title = apply_filters('widget_title', $title, $instance, $this->id_base);
     $current_term = false;
     $current_term_id = $current_post_id = 0;
     if (suwp::is_tax($current_taxonomy)) {
         $current_term = $wp_query->get_queried_object();
         $current_term_id = $wp_query->get_queried_object_id();
         $title = $current_term->name;
     } elseif (is_singular()) {
         $current_post_id = $wp_query->get_queried_object_id();
         $post_terms = get_the_terms($current_post_id, $current_taxonomy);
         if (is_array($post_terms) && count($post_terms)) {
             $current_term = reset($post_terms);
             $current_term_id = $current_term->term_id;
             $title = $current_term->name;
         }
     }
     $term_args = array('taxonomy' => $current_taxonomy, 'orderby' => 'name', 'show_count' => $count ? '1' : '0', 'hierarchical' => '0', 'title_li' => '', 'parent' => $current_term_id, 'show_option_none' => false, 'use_desc_for_title' => $use_desc_for_title ? '1' : '0', 'echo' => false);
     $category_output = $post_output = '';
     if (!$current_term || is_taxonomy_hierarchical($current_taxonomy)) {
         $category_output = wp_list_categories($term_args);
     }
     if ($current_term) {
         $child_posts = get_posts(array('taxonomy' => $current_taxonomy, 'term' => $current_term->slug, 'numberposts' => 5));
         foreach ($child_posts as $child_post) {
             $css_class = '';
             if ($child_post->ID == $current_post_id) {
                 $css_class = 'current_post_item';
             }
             $post_output .= "\n\t\t\t<li class=\"" . $css_class . '"><a href="' . get_permalink($child_post->ID) . '" title="' . esc_attr(wp_strip_all_tags(apply_filters('the_title', $child_post->post_title, $child_post->ID))) . '">' . apply_filters('the_title', $child_post->post_title, $child_post->ID) . "</a></li>\n";
         }
     }
     if ($category_output || $post_output) {
         echo $before_widget;
         if ($title) {
             echo $before_title . $title . $after_title;
         }
         echo "\n\t\t<ul>\n";
         echo $category_output;
         echo $post_output;
         echo "\n\t\t</ul>\n";
         echo $after_widget;
     }
 }
コード例 #20
0
 public function filter_content($content)
 {
     // Get Templates
     $templates = self::get_option('rwp_templates');
     $terms = wp_get_object_terms(get_the_ID(), array_keys(get_taxonomies()));
     $terms_keys = array();
     foreach ($terms as $term) {
         $terms_keys[$term->taxonomy][] = $term->term_id;
     }
     //self::pretty_print( $terms_keys );
     foreach ($templates as $template) {
         if (isset($template['template_auto_reviews']) && !empty($template['template_auto_reviews'])) {
             if (is_singular($template['template_auto_reviews']) && is_main_query()) {
                 if (isset($template['template_exclude_terms'])) {
                     $to_exclude = false;
                     foreach ($template['template_exclude_terms'] as $id) {
                         $i = explode('-', $id);
                         if (in_array($i[1], $terms_keys[$i[0]])) {
                             $to_exclude = true;
                             break;
                         }
                     }
                     if ($to_exclude) {
                         continue;
                     }
                 }
                 $new_content = '[rwp-review id="-1" template="' . $template['template_id'] . '"]';
                 $content .= $new_content;
             }
         }
     }
     return $content;
 }
コード例 #21
0
function localedge_scripts_and_styles()
{
    global $wp_styles;
    // call global $wp_styles variable to add conditional wrapper around ie stylesheet the WordPress way
    // modernizr (without media query polyfill)
    wp_enqueue_script('localedge-modernizr', '//cdnjs.cloudflare.com/ajax/libs/modernizr/2.7.1/modernizr.min.js', false, null);
    // respondjs
    wp_enqueue_script('localedge-respondjs', '//cdnjs.cloudflare.com/ajax/libs/respond.js/1.4.2/respond.js', false, null);
    // register main stylesheet
    wp_enqueue_style('localedge-stylesheet', get_stylesheet_directory_uri() . '/css/style.css', array(), '', 'all');
    // ie-only style sheet
    wp_enqueue_style('localedge-ie-only', get_stylesheet_directory_uri() . '/css/ie.css', array(), '');
    $wp_styles->add_data('localedge-ie-only', 'conditional', 'lt IE 9');
    // add conditional wrapper around ie stylesheet
    //Magnific Popup (LightBox)
    wp_enqueue_script('localedge-magnific-popup-js', '//cdnjs.cloudflare.com/ajax/libs/magnific-popup.js/0.9.9/jquery.magnific-popup.min.js', array('jquery'), '0.9.9', true);
    //Font Awesome (icon set)
    wp_enqueue_style('localedge-font-awesome', '//cdnjs.cloudflare.com/ajax/libs/font-awesome/4.0.3/css/font-awesome.min.css', array(), '4.0.3');
    // iCheck (better radio and checkbox inputs)
    wp_enqueue_script('localedge-icheck', '//cdnjs.cloudflare.com/ajax/libs/iCheck/1.0.1/icheck.min.js', array('jquery'), '1.0.1', true);
    //Chosen - http://harvesthq.github.io/chosen/
    wp_enqueue_script('chosen-js', '//cdnjs.cloudflare.com/ajax/libs/chosen/1.1.0/chosen.jquery.min.js', array('jquery'), '1.1.0', true);
    // comment reply script for threaded comments
    if (is_singular() and comments_open() and get_option('thread_comments') == 1) {
        wp_enqueue_script('comment-reply');
    }
    //adding scripts file in the footer
    wp_enqueue_script('localedge-js', get_stylesheet_directory_uri() . '/js/scripts.js', array('jquery'), '', true);
}
コード例 #22
0
ファイル: scripts.php プロジェクト: mukeshkumar108/wd_s
/**
 * Enqueue scripts and styles.
 */
function _s_scripts()
{
    /**
     * If WP is in script debug, or we pass ?script_debug in a URL - set debug to true.
     */
    $debug = defined('SCRIPT_DEBUG') && SCRIPT_DEBUG == true || isset($_GET['script_debug']) ? true : false;
    /**
     * If we are debugging the site, use a unique version every page load so as to ensure no cache issues.
     */
    $version = '1.0.0';
    /**
     * Should we load minified scripts? Also enqueue live reload to allow for extensionless reloading.
     */
    $suffix = '.min';
    if (true === $debug) {
        $suffix = '';
        wp_enqueue_script('live-reload', '//localhost:35729/livereload.js', array(), $version, true);
    }
    wp_enqueue_style('_s-google-font', _s_font_url(), array(), null);
    wp_enqueue_style('_s-style', get_stylesheet_directory_uri() . '/style' . $suffix . '.css', array(), $version);
    wp_enqueue_script('_s-project', get_template_directory_uri() . '/assets/js/project' . $suffix . '.js', array('jquery'), $version, true);
    if (is_singular() && comments_open() && get_option('thread_comments')) {
        wp_enqueue_script('comment-reply');
    }
}
コード例 #23
0
/**
 * Register jquery scripts
 */
function spacious_scripts_styles_method()
{
    /**
     * Loads our main stylesheet.
     */
    wp_enqueue_style('spacious_style', get_stylesheet_uri());
    if (of_get_option('spacious_color_skin', 'light') == 'dark') {
        wp_enqueue_style('spacious_dark_style', SPACIOUS_CSS_URL . '/dark.css');
    }
    /**
     * Adds JavaScript to pages with the comment form to support
     * sites with threaded comments (when in use).
     */
    if (is_singular() && comments_open() && get_option('thread_comments')) {
        wp_enqueue_script('comment-reply');
    }
    /**
     * Register JQuery cycle js file for slider.
     */
    wp_register_script('jquery_cycle', SPACIOUS_JS_URL . '/jquery.cycle.all.min.js', array('jquery'), '2.9999.5', true);
    //   wp_register_style( 'google_fonts', 'http://fonts.googleapis.com/css?family=Lato' );
    /**
     * Enqueue Slider setup js file.	 
     */
    if (is_home() || is_front_page() && of_get_option('spacious_activate_slider', '0') == '1') {
        wp_enqueue_script('spacious_slider', SPACIOUS_JS_URL . '/spacious-slider-setting.js', array('jquery_cycle'), false, true);
    }
    wp_enqueue_script('spacious-navigation', SPACIOUS_JS_URL . '/navigation.js', array('jquery'), false, true);
    wp_enqueue_script('spacious-custom', SPACIOUS_JS_URL . '/spacious-custom.js', array('jquery'));
    wp_enqueue_style('google_fonts');
    $spacious_user_agent = strtolower($_SERVER['HTTP_USER_AGENT']);
    if (preg_match('/(?i)msie [1-8]/', $spacious_user_agent)) {
        wp_enqueue_script('html5', SPACIOUS_JS_URL . '/html5.js', true);
    }
}
コード例 #24
0
function cleansimplewhite_scripts()
{
    wp_enqueue_style('cleansimplewhite-style', get_stylesheet_uri(), array(), '1.4.2');
    if (is_singular() && comments_open() && get_option('thread_comments')) {
        wp_enqueue_script('comment-reply');
    }
}
コード例 #25
0
/**
 * Enqueue scripts and styles for the theme.
 */
function fast_scripts()
{
    //LOAD style.css via filesystem. Uses Sass to ompile '/assets/scss/style.scss' to: 'styl.css'
    wp_enqueue_style('fast-sass', get_stylesheet_uri(), array(), '1.0.0');
    //LOAD jQuery.min.js via CDN JS
    wp_enqueue_script('fast-jquery', 'https://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.4/jquery.min.js', array(), '1.0.0', true);
    //LOAD Boostrap.min.js via CDN JS
    wp_enqueue_script('fast-bootstrap', 'https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.5/js/bootstrap.min.js', array(), '1.0.0', true);
    //LOAD navigation.js via filesystem
    wp_enqueue_script('fast-navigation', get_template_directory_uri() . '/assets/js/navigation.js', array(), '1.0.0', true);
    //LOAD fast-skip-link-focus.js via filesystem
    //wp_enqueue_script( 'fast-skip-link-focus-fix', get_template_directory_uri() . '/assets/js/skip-link-focus-fix.js', array(), '1.0.0', true );
    //LOAD instantclick.js via CDN JS
    wp_enqueue_script('fast-instantclick', 'https://cdnjs.cloudflare.com/ajax/libs/instantclick/3.0.1/instantclick.min.js', array(), '1.0.0', true);
    //CALL instant click into end of footer scripts, for init
    function call_instant_click()
    {
        echo '<script data-no-instant>InstantClick.init();</script>';
    }
    add_action('wp_footer', 'call_instant_click', 200);
    //load at end
    //IF IS singlular & comments are enabled, load comment-reply.js via filesystem
    if (is_singular() && comments_open() && get_option('thread_comments')) {
        wp_enqueue_script('comment-reply');
    }
}
コード例 #26
0
 /**
  * the_content filter that will add linked posts to the bottom of the main post content
  *
  * @param $content
  *
  * @return string
  */
 public function run($content)
 {
     /**
      * Wow, what's going on here?! Well, setup_postdata() sets a lot of variables but does not change the $post variable.
      * All checks return the main queried ID but we want to check if this specific filter call is the for the 'main' content.
      * The method setup_postdata() does global and set the $id variable, so we're checking that.
      */
     global $id;
     // Only run on single
     if (!is_singular() || !is_main_query() || $id != get_queried_object_id()) {
         return $content;
     }
     // Allow disabling content filter
     if (false === apply_filters('rp4wp_append_content', true)) {
         return $content;
     }
     // The Post Type
     $post_type = get_post_type($id);
     // The Post Type Manager
     $pt_manager = new RP4WP_Post_Type_Manager();
     // Check if this Post Type is installed
     if ($pt_manager->is_post_type_installed($post_type) && isset(RP4WP()->settings['general_' . $post_type])) {
         // Related Post Manager
         $related_post_manager = new RP4WP_Related_Post_Manager();
         // The Output
         $output = $related_post_manager->generate_related_posts_list($id);
         // Add output if there is any
         if ('' != $output) {
             $content .= $output;
         }
     }
     // Return the content
     return $content;
 }
コード例 #27
0
function featured_post_image()
{
    if (!is_front_page() && is_singular()) {
        the_post_thumbnail('large');
        //you can use medium, large or a custom size
    }
}
コード例 #28
0
ファイル: functions.php プロジェクト: narabikke/wordpress
function lifestyle_banner()
{
    ?>
	<div class="banner">
		<div class="wrap">
			<?php 
    if (is_front_page()) {
        lifestyle_get_home_banner();
    } elseif (!is_front_page() && get_theme_mod('lifestyle_header_home')) {
        echo '';
    } else {
        // get title
        $id = get_option('page_for_posts');
        if (is_home() || is_singular('post')) {
            if (has_post_thumbnail($id)) {
                echo get_the_post_thumbnail($id, 'full');
            }
        } elseif (has_post_thumbnail() && is_singular('page')) {
            the_post_thumbnail();
        }
    }
    ?>
		</div><!-- .wrap -->
  	</div><!-- .banner -->
<?php 
}
コード例 #29
0
 /**
  * Check for a single-{post-type} situation.
  *
  * @param string $postType The post type to check for
  * @param array $details Settings for the route
  */
 private static function single($postType, array $details)
 {
     if (is_singular($postType)) {
         self::loadController($details);
         exit;
     }
 }
コード例 #30
0
ファイル: functions.php プロジェクト: jchristopher/jbaths
/**
 * Enqueue scripts and styles.
 */
function jbaths_scripts()
{
    $theme = wp_get_theme();
    // wtf
    wp_enqueue_style('wtf-forms', get_template_directory_uri() . '/css/wtf-forms.css', array(), '2.2.0');
    // and then
    wp_enqueue_style('jbaths', get_stylesheet_uri(), array(), $theme->Version . '.1');
    // store locator plus - specialty css
    if (is_page('find-a-showroom')) {
        wp_enqueue_style('jbaths-slp', get_template_directory_uri() . '/css/slp-baths.css', array(), $theme->Version);
        // store locator plus
    }
    if (!is_admin()) {
        wp_register_script('jbaths.modernizr', get_stylesheet_directory_uri() . '/js/modernizr.min.js', array(), '2.8.3', true);
        wp_register_script('jquery.cookie', get_stylesheet_directory_uri() . '/js/jquery.cookie.js', array('jquery'), $theme->Version);
        wp_register_script('scrollupforwhat', get_stylesheet_directory_uri() . '/js/jquery.scrollupforwhat.min.js', array('jquery'), '1.2', true);
        wp_register_script('matchHeight', get_template_directory_uri() . '/js/jquery.matchHeight.js', array('jquery'), '0.5.2', true);
        $jbaths_deps = array('jquery', 'jbaths.modernizr', 'jquery.cookie', 'scrollupforwhat', 'matchHeight');
        if (is_singular('bathtubs') || is_singular('faucets')) {
            if (get_option('ultimate_row') == "enable") {
                //$jbaths_deps[] = 'ultimate-row-bg';
            }
        }
        wp_enqueue_script('jbaths', get_template_directory_uri() . '/js/baths.js', $jbaths_deps, '20140718', true);
    }
    wp_enqueue_script('skip-link-focus-fix', get_template_directory_uri() . '/js/skip-link-focus-fix.js', array(), '20130115', true);
    // Omniture SiteCatalyst
    wp_enqueue_script('sitecatalyst', get_template_directory_uri() . '/js/s_code.js', array(), $theme->Version, true);
    if (is_singular('post') && comments_open() && get_option('thread_comments')) {
        wp_enqueue_script('comment-reply');
    }
}