• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP wpex_option函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中wpex_option函数的典型用法代码示例。如果您正苦于以下问题:PHP wpex_option函数的具体用法?PHP wpex_option怎么用?PHP wpex_option使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了wpex_option函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: wpex_site_tracking_header

 function wpex_site_tracking_header()
 {
     $tracking = wpex_option('tracking');
     if ($tracking !== '') {
         echo wpex_option('tracking');
     }
 }
开发者ID:nhatnam1102,项目名称:wp-content,代码行数:7,代码来源:tracking-code.php


示例2: wpex_search_overlay

    function wpex_search_overlay()
    {
        // Do nothing if the main search is disabled
        if (wpex_option('main_search', '1') !== '1') {
            return;
        }
        // Only display on header style 1
        if (wpex_option('header_style', 'one') !== 'one') {
            return;
        }
        ob_start();
        ?>
			
			<span class="search-overlay"></span>
			<section id="site-searchform" class="header-one-searchform">
				<div id="site-searchform-title"><?php 
        _e('Search', 'wpex');
        ?>
</div>
				<div class="site-searchform-inner clr">
					<form method="get" action="<?php 
        echo esc_url(home_url('/'));
        ?>
" role="search">
						<input type="search" name="s" onfocus="if(this.value==this.defaultValue)this.value='';" onblur="if(this.value=='')this.value=this.defaultValue;" autocomplete="off" />
					</form>
				</div><!-- .site-searchform-inner -->
			</section><!-- #site-searchform -->
		<?php 
        echo ob_get_clean();
    }
开发者ID:nhatnam1102,项目名称:wp-content,代码行数:31,代码来源:search-overlay.php


示例3: wpex_footer_callout

    function wpex_footer_callout()
    {
        // Lets bail if the callout is disabled for this page/post --> see previous function
        if (wpex_display_callout() == false) {
            return;
        }
        // Get theme options
        $callout_text = wpex_option('callout_text');
        $callout_link = wpex_option('callout_link');
        $callout_link_txt = wpex_option('callout_link_txt');
        $callout_rel = wpex_option('callout_button_rel', 'dofollow');
        $callout_target = wpex_option('callout_button_target', 'blank');
        $rel = $callout_rel == 'nofollow' ? 'rel="nofollow"' : '';
        ob_start();
        ?>
		
			<div id="footer-callout-wrap" class="clr">
				<div id="footer-callout" class="clr container">
					<div id="footer-callout-left" class="clr <?php 
        if (wpex_option('callout_link') == '') {
            echo 'full-width';
        }
        ?>
">
						<?php 
        // Echo the footer callout text
        echo $callout_text;
        ?>
					</div><!-- #footer-callout-left -->
					<?php 
        // Display footer callout button if callout link & text options are not blank in the admin
        if ($callout_link && $callout_link_txt) {
            ?>
						<div id="footer-callout-right" class="">
							<a href="<?php 
            echo $callout_link;
            ?>
" class="theme-button" title="<?php 
            echo $callout_link_txt;
            ?>
" target="_<?php 
            echo $callout_target;
            ?>
" <?php 
            echo $rel;
            ?>
><?php 
            echo $callout_link_txt;
            ?>
</a>
						</div><!-- #footer-callout-right -->
					<?php 
        }
        ?>
				</div><!-- #footer-callout -->
			</div><!-- #footer-callout-wrap -->
			
		<?php 
        echo ob_get_clean();
    }
开发者ID:nhatnam1102,项目名称:wp-content,代码行数:60,代码来源:footer-callout.php


示例4: wpex_get_sidebar

 function wpex_get_sidebar($sidebar = 'sidebar')
 {
     // Pages
     $custom_pages_sidebar = wpex_option('pages_custom_sidebar', '1');
     if (is_singular('pages') && $custom_pages_sidebar == '1') {
         return 'pages_sidebar';
     }
     // Staff
     $custom_staff_sidebar = wpex_option('staff_custom_sidebar', '1');
     if (is_singular('staff') && $custom_staff_sidebar == '1') {
         return 'staff_sidebar';
     }
     // Portfolio
     $custom_portfolio_sidebar = wpex_option('portfolio_custom_sidebar', '1');
     if (is_singular('portfolio') && $custom_portfolio_sidebar == '1') {
         return 'portfolio_sidebar';
     }
     // WooCommerce
     if (class_exists('Woocommerce')) {
         $woo_custom_sidebar = wpex_option('woo_custom_sidebar', '1');
         if ($woo_custom_sidebar == '1' && is_woocommerce()) {
             return 'woo_sidebar';
         }
     }
     // Return the correct sidebar name & add useful hook
     return apply_filters('wpex_get_sidebar', $sidebar);
 }
开发者ID:nhatnam1102,项目名称:wp-content,代码行数:27,代码来源:get-sidebar.php


示例5: wpex_post_entry_author_avatar_enabled

 function wpex_post_entry_author_avatar_enabled()
 {
     // Theme settings
     $author_avatar_toggle = wpex_option('blog_entry_author_avatar');
     $blog_style = wpex_option('blog_style');
     if ($author_avatar_toggle !== '1') {
         return false;
     }
     if (!is_category() && $blog_style !== 'large-image-entry-style') {
         return false;
     }
     // Category settings
     if (is_category()) {
         $term = get_query_var('cat');
         $term_data = get_option("category_{$term}");
         if (isset($term_data['wpex_term_style'])) {
             if ($term_data['wpex_term_style'] !== '') {
                 $blog_style = $term_data['wpex_term_style'];
             }
         }
         if ($blog_style !== 'large-image-entry-style') {
             return false;
         }
     }
     // End if category check
     return true;
     // If all else fails return true
 }
开发者ID:nhatnam1102,项目名称:wp-content,代码行数:28,代码来源:post-entry-author-avatar.php


示例6: wpex_blog_exclude_categories

 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);
     }
 }
开发者ID:nhatnam1102,项目名称:wp-content,代码行数:29,代码来源:blog-exclude-categories.php


示例7: wpex_post_meta

    function wpex_post_meta()
    {
        global $post;
        $post_id = $post->ID;
        $category = get_the_category();
        $fist_category = $category[0];
        ob_start();
        ?>
		
		<ul class="meta clr">
			<li class="meta-date"><span class="fa fa-clock-o"></span><?php 
        echo get_the_date();
        ?>
</li>
			<?php 
        if ($fist_category) {
            ?>
				<li class="meta-category"><span class="fa fa-folder-o"></span><a href="<?php 
            echo get_category_link($category[0]->term_id);
            ?>
" title="<?php 
            echo $category[0]->cat_name;
            ?>
"><?php 
            echo $category[0]->cat_name;
            ?>
</a></li>
			<?php 
        }
        ?>
			<?php 
        if (comments_open()) {
            ?>
				<li class="meta-comments comment-scroll"><span class="fa fa-comment-o"></span><?php 
            comments_popup_link(__('0 Comments', 'wpex'), __('1 Comment', 'wpex'), __('% Comments', 'wpex'), 'comments-link');
            ?>
</li>
			<?php 
        }
        ?>
			<?php 
        if (is_singular('post') && wpex_option('post_next_prev_meta', '1') == '1') {
            ?>
				<li id="single-post-next-prev" class="clr">
					<?php 
            next_post_link('%link', '<span class="theme-button"><span class="fa fa-chevron-left"></span></span>');
            ?>
					<?php 
            previous_post_link('%link', '<span class="theme-button"><span class="fa fa-chevron-right"></span></span>');
            ?>
				</li><!-- #single-post-next-prev -->
			<?php 
        }
        ?>
		</ul>
		
		<?php 
        echo ob_get_clean();
    }
开发者ID:nhatnam1102,项目名称:wp-content,代码行数:59,代码来源:post-meta.php


示例8: wpex_custom_testimonials_args

 function wpex_custom_testimonials_args($args)
 {
     //post name based on theme options
     $post_type_name = wpex_option('testimonials_labels', __('Testimonials', 'wpex'));
     $post_slug = wpex_option('testimonials_slug', 'testimonial-item');
     $labels = array('name' => $post_type_name, 'singular_name' => $post_type_name . ' ' . __('Item', 'wpex'), 'add_new' => __('Add New Item', 'wpex'), 'add_new_item' => __('Add New', 'wpex') . ' ' . $post_type_name . ' ' . __('Item', 'wpex'), 'edit_item' => __('Edit New', 'wpex') . ' ' . $post_type_name . ' ' . __('Item', 'wpex'), 'new_item' => __('Add New', 'wpex') . ' ' . $post_type_name . ' ' . __('Item', 'wpex'), 'view_item' => __('View Item', 'wpex'), 'search_items' => __('Search', 'wpex') . $post_type_name, 'not_found' => __('No', 'wpex') . ' ' . $post_type_name . ' ' . __('items found', 'wpex'), 'not_found_in_trash' => __('No', 'wpex') . ' ' . $post_type_name . ' ' . __('items found in the trash', 'wpex'));
     $custom_args = array('labels' => $labels, 'rewrite' => array("slug" => $post_slug));
     return $custom_args + $args;
 }
开发者ID:nhatnam1102,项目名称:wp-content,代码行数:9,代码来源:post-type-labels.php


示例9: wpex_remove_wp_ver_css_js

 function wpex_remove_wp_ver_css_js($src)
 {
     if (wpex_option('remove_scripts_version', '1') == '1') {
         if (strpos($src, 'ver=')) {
             $src = remove_query_arg('ver', $src);
         }
     }
     return $src;
 }
开发者ID:nhatnam1102,项目名称:wp-content,代码行数:9,代码来源:scripts.php


示例10: wpex_custom_testimonials_category_args

 function wpex_custom_testimonials_category_args($args)
 {
     //post name based on theme options
     $post_type_name = wpex_option('testimonials_labels', 'Testimonials') ? wpex_option('testimonials_labels', 'Testimonials') : 'Testimonials';
     $tax_slug = wpex_option('testimonials_cat_slug', 'testimonials-category') ? wpex_option('testimonials_cat_slug', 'testimonials-category') : 'testimonials-category';
     $taxonomy_testimonials_category_labels = array('name' => $post_type_name . ' ' . __('Categories', 'wpex'), 'singular_name' => $post_type_name . ' ' . __('Category', 'wpex'), 'search_items' => __('Search', 'wpex') . ' ' . $post_type_name . ' ' . __('Category', 'wpex'), 'popular_items' => __('Popular', 'wpex') . ' ' . $post_type_name . ' ' . __('Categories', 'wpex'), 'all_items' => __('All', 'wpex') . ' ' . $post_type_name . ' ' . __('Categories', 'wpex'), 'parent_item' => __('Parent', 'wpex') . ' ' . $post_type_name . ' ' . __('Category', 'wpex'), 'parent_item_colon' => __('Parent', 'wpex') . ' ' . $post_type_name . ' ' . __('Category', 'wpex'), 'edit_item' => __('Edit', 'wpex') . ' ' . $post_type_name . ' ' . __('Category', 'wpex'), 'update_item' => __('Update', 'wpex') . ' ' . $post_type_name . ' ' . __('Category', 'wpex'), 'add_new_item' => __('Add New', 'wpex') . ' ' . $post_type_name . ' ' . __('Category', 'wpex'), 'new_item_name' => __('New', 'wpex') . ' ' . $post_type_name . ' ' . __('Category name', 'wpex'), 'separate_items_with_commas' => __('Seperate', 'wpex') . ' ' . $post_type_name . ' ' . __('categories with commas', 'wpex'), 'add_or_remove_items' => __('Add or remove', 'wpex') . ' ' . $post_type_name . ' ' . __('categories', 'wpex'), 'choose_from_most_used' => __('Choose from the most used', 'wpex') . ' ' . $post_type_name . ' ' . __('categories', 'wpex'), 'menu_name' => $post_type_name . ' ' . __('Categories', 'wpex'));
     $custom_taxonomy_testimonials_category_args = array('labels' => $taxonomy_testimonials_category_labels, 'rewrite' => array('slug' => $tax_slug));
     return $custom_taxonomy_testimonials_category_args + $args;
 }
开发者ID:nhatnam1102,项目名称:wp-content,代码行数:9,代码来源:taxonomies-labels.php


示例11: wpex_get_post_layout_class

 function wpex_get_post_layout_class()
 {
     // Vars
     $class = 'right-sidebar';
     $post_types = get_post_types('', 'names');
     $blog_archives_layout = wpex_option('blog_archives_layout', 'right-sidebar');
     // Loop through post types
     foreach ($post_types as $post_type) {
         if (is_singular($post_type)) {
             if ($post_type == 'post') {
                 $post_type = 'blog';
             }
             global $post;
             $post_id = $post->ID;
             $admin_id = $post_type . '_single_layout';
             $admin_setting = wpex_option($admin_id, 'right-sidebar');
             $meta = get_post_meta($post_id, 'wpex_post_layout', true);
             if ($meta !== '') {
                 $class = $meta;
             } else {
                 $class = $admin_setting;
             }
         }
     }
     // Archives
     if (is_archive() || is_author() || is_page_template('templates/blog.php')) {
         $class = $blog_archives_layout;
     }
     // Cats
     if (is_category()) {
         $term = get_query_var('cat');
         $term_data = get_option("category_{$term}");
         if ($term_data) {
             if ($term_data['wpex_term_layout'] !== '') {
                 $class = $term_data['wpex_term_layout'];
             }
         } else {
             $class = $blog_archives_layout;
         }
     }
     // Portfolio tax
     if (is_tax('portfolio_category') || is_tax('portfolio_tag')) {
         $class = wpex_option('portfolio_archive_layout', 'full-width');
     }
     // Staff tax
     if (is_tax('staff_category') || is_tax('staff_tag')) {
         $class = wpex_option('staff_archive_layout', 'full-width');
     }
     // Testimonials tax
     if (is_tax('testimonials_category') || is_tax('testimonials_tag')) {
         $class = wpex_option('testimonials_archive_layout', 'full-width');
     }
     // Return the correct class name
     $class = apply_filters('wpex_post_layout_class', $class);
     return $class;
 }
开发者ID:nhatnam1102,项目名称:wp-content,代码行数:56,代码来源:post-layout.php


示例12: wpex_footer_copyright

 function wpex_footer_copyright()
 {
     $output;
     $copyright = wpex_option('footer_copyright');
     $copyright_content = wpex_option('footer_copyright_text');
     if ($copyright !== '1') {
         return;
     }
     $output = do_shortcode($copyright_content);
     $output = apply_filters('wpex_copyright_info', $output);
     echo $output;
 }
开发者ID:nhatnam1102,项目名称:wp-content,代码行数:12,代码来源:footer-copyright.php


示例13: wpex_get_header_style

 function wpex_get_header_style($style = 'one')
 {
     $style = wpex_option('header_style', 'one');
     if (is_singular()) {
         global $post;
         $post_id = $post->ID;
         $meta = get_post_meta($post_id, 'wpex_header_style', true);
         if ($meta) {
             $style = $meta;
         }
     }
     return $style;
 }
开发者ID:nhatnam1102,项目名称:wp-content,代码行数:13,代码来源:header-display.php


示例14: wpex_layout_css

    function wpex_layout_css()
    {
        $custom_css = '';
        // Main Container With
        $main_container_width = wpex_option('main_container_width');
        if ($main_container_width !== '' && $main_container_width !== '980px') {
            $custom_css .= '@media only screen and (min-width: 960px) {
				.container, .wpb_row .wpb_row, .vc_row-fluid.container, .boxed-main-layout #wrap { width: ' . $main_container_width . '; }
				.boxed-main-layout .is-sticky #site-header { width: ' . $main_container_width . '; }
			}';
        }
        // Left container width
        $left_container_width = wpex_option('left_container_width');
        if ($left_container_width !== '' && $left_container_width !== '680px') {
            $custom_css .= '@media only screen and (min-width: 960px) {
				.content-area { width: ' . $left_container_width . '; }
			}';
        }
        // Sidebar width
        $sidebar_width = wpex_option('sidebar_width');
        if ($sidebar_width !== '' && $sidebar_width !== '260px') {
            $custom_css .= '@media only screen and (min-width: 960px) {#sidebar { width: ' . $sidebar_width . '; }}';
        }
        // Header Top Padding
        $header_top_padding = wpex_option('header_top_padding');
        if ($header_top_padding !== '' && $header_top_padding !== '30px') {
            $custom_css .= '#site-header-inner { padding-top: ' . intval($header_top_padding) . 'px; }';
        }
        // Header Bottom Padding
        $header_bottom_padding = wpex_option('header_bottom_padding');
        if ($header_bottom_padding !== '' && $header_bottom_padding !== '30px') {
            $custom_css .= '#site-header-inner { padding-bottom: ' . intval($header_bottom_padding) . 'px; }';
        }
        // Logo top margin
        $logo_top_margin = wpex_option('logo_top_margin');
        if ($logo_top_margin !== '' && $logo_top_margin !== '0px') {
            $custom_css .= '#site-logo { margin-top: ' . intval($logo_top_margin) . 'px; }';
        }
        // Logo bottom margin
        $logo_bottom_margin = wpex_option('logo_bottom_margin');
        if ($logo_bottom_margin !== '' && $logo_bottom_margin !== '0px') {
            $custom_css .= '#site-logo { margin-bottom: ' . intval($logo_bottom_margin) . 'px; }';
        }
        // trim white space for faster page loading
        $custom_css_trimmed = preg_replace('/\\s+/', ' ', $custom_css);
        // output css on front end
        $css_output = "<!-- Custom CSS -->\n<style type=\"text/css\">\n" . $custom_css_trimmed . "\n</style>";
        if (!empty($custom_css)) {
            echo $css_output;
        }
    }
开发者ID:nhatnam1102,项目名称:wp-content,代码行数:51,代码来源:layout.php


示例15: wpex_mobile_menu

    function wpex_mobile_menu()
    {
        // If responsive is disabled, bail
        if (wpex_option('responsive', '1') !== '1') {
            return false;
        }
        // Vars
        $mobile_menu_contact = wpex_option('mobile_menu_contact');
        $mobile_menu_rss = wpex_option('mobile_menu_rss');
        ob_start();
        ?>
		
		<!-- Mobile navigation -->
		<div id="sidr-close">
			<a href="#sidr-close" class="toggle-sidr-close"></a>
		</div>
		<div id="mobile-menu" class="clr">
			<a href="#sidr" class="mobile-menu-toggle"><span class="fa fa-bars"></span></a>
			<?php 
        // Display items from the mobile menu
        $menu_name = 'mobile_menu';
        if (($locations = get_nav_menu_locations()) && isset($locations[$menu_name])) {
            $menu = wp_get_nav_menu_object($locations[$menu_name]);
            $menu_items = wp_get_nav_menu_items($menu->term_id);
            foreach ((array) $menu_items as $key => $menu_item) {
                $title = $menu_item->title;
                $url = $menu_item->url;
                $attr_title = $menu_item->attr_title;
                ?>
					<a href="<?php 
                echo $url;
                ?>
" title="<?php 
                echo $attr_title;
                ?>
" class="mobile-menu-extra-icons mobile-menu-<?php 
                echo $title;
                ?>
"><span class="fa fa-<?php 
                echo $title;
                ?>
"></span></a>
				<?php 
            }
        }
        ?>
		</div><!-- #mobile-menu -->

		<?php 
        echo ob_get_clean();
    }
开发者ID:nhatnam1102,项目名称:wp-content,代码行数:51,代码来源:mobile-menu.php


示例16: wpex_custom_css

 function wpex_custom_css()
 {
     $custom_css = '';
     if (wpex_option('custom_css') !== '') {
         $custom_css .= wpex_option('custom_css');
     }
     // trim white space for faster page loading
     $custom_css_trimmed = preg_replace('/\\s+/', ' ', $custom_css);
     // output css on front end
     $css_output = "<!-- Custom CSS -->\n<style type=\"text/css\">\n" . $custom_css_trimmed . "\n</style>";
     if (!empty($custom_css)) {
         echo $css_output;
     }
 }
开发者ID:nhatnam1102,项目名称:wp-content,代码行数:14,代码来源:custom-css.php


示例17: wpex_tweak_testimonials_args

 function wpex_tweak_testimonials_args($args)
 {
     // Vars
     $search = wpex_option('testimonials_search', '1');
     $menu_icon = wpex_option('testimonials_admin_icon', false, 'url');
     // Tweaks
     if ($search !== '1') {
         $args['exclude_from_search'] = true;
     }
     if ($menu_icon !== '') {
         $args['menu_icon'] = $menu_icon;
     }
     return $args;
 }
开发者ID:nhatnam1102,项目名称:wp-content,代码行数:14,代码来源:tweak.php


示例18: wpex_responsive_widths

 function wpex_responsive_widths()
 {
     if (wpex_option('custom_mobile_widths', '1') !== '1') {
         return;
     }
     $custom_css = '';
     // Tablet Widths
     $tablet_main_container_width = wpex_option('tablet_main_container_width');
     $tablet_main_container_width = $tablet_main_container_width !== '700px' ? $tablet_main_container_width : '';
     $tablet_left_container_width = wpex_option('tablet_left_container_width');
     $tablet_left_container_width = $tablet_left_container_width !== '440px' ? $tablet_left_container_width : '';
     $tablet_sidebar_width = wpex_option('tablet_sidebar_width');
     $tablet_sidebar_width = $tablet_sidebar_width !== '220px' ? $tablet_sidebar_width : '';
     if ($tablet_main_container_width || $tablet_left_container_width || $tablet_sidebar_width) {
         $custom_css .= '@media only screen and (min-width: 768px) and (max-width: 959px) {';
         if ($tablet_main_container_width) {
             $custom_css .= '.container, .wpb_row .wpb_row, .vc_row-fluid.container { width: ' . $tablet_main_container_width . '; }';
         }
         if ($tablet_left_container_width) {
             $custom_css .= '.content-area { width: ' . $tablet_left_container_width . ' !important; }';
         }
         if ($tablet_sidebar_width) {
             $custom_css .= '#sidebar { width: ' . $tablet_sidebar_width . ' !important; }';
         }
         $custom_css .= '}';
     }
     // Mobile Portrait
     $mobile_portrait_main_container_width = wpex_option('mobile_portrait_main_container_width');
     $mobile_portrait_main_container_width = $mobile_portrait_main_container_width !== '90%' ? $mobile_portrait_main_container_width : '';
     if ($mobile_portrait_main_container_width) {
         $custom_css .= '@media only screen and (max-width: 767px) { .container, .wpb_row .wpb_row, .vc_row-fluid.container { width: ' . $mobile_portrait_main_container_width . ' !important; min-width: 0; } }';
     }
     // Mobile Landscape
     $mobile_landscape_main_container_width = wpex_option('mobile_landscape_main_container_width');
     $mobile_landscape_main_container_width = $mobile_landscape_main_container_width !== '480px' ? $mobile_landscape_main_container_width : '';
     if ($mobile_landscape_main_container_width) {
         $custom_css .= '@media only screen and (min-width: 480px) and (max-width: 767px) { .container, .wpb_row .wpb_row, .vc_row-fluid.container { width: ' . $mobile_landscape_main_container_width . ' !important; } }';
     }
     // trim white space for faster page loading
     $custom_css_trimmed = preg_replace('/\\s+/', ' ', $custom_css);
     // output css on front end
     $css_output = "<!-- Custom CSS -->\n<style type=\"text/css\">\n" . $custom_css_trimmed . "\n</style>";
     if (!empty($custom_css)) {
         echo $css_output;
     }
 }
开发者ID:nhatnam1102,项目名称:wp-content,代码行数:46,代码来源:responsive-widths.php


示例19: display_element

 function display_element($element, &$children_elements, $max_depth, $depth = 0, $args, &$output)
 {
     $id_field = $this->db_fields['id'];
     if (!empty($children_elements[$element->{$id_field}]) && $depth == 0) {
         $element->classes[] = 'dropdown';
         if (wpex_option('menu_arrow_down', '0') == '1') {
             $element->title .= ' <span class="nav-arrow fa fa-angle-down"></span>';
         }
     }
     if (!empty($children_elements[$element->{$id_field}]) && $depth > 0) {
         $element->classes[] = 'dropdown';
         if (wpex_option('menu_arrow_side', '1') == '1') {
             $element->title .= ' <span class="nav-arrow fa fa-angle-right"></span>';
         }
     }
     Walker_Nav_Menu::display_element($element, $children_elements, $max_depth, $depth, $args, $output);
 }
开发者ID:nhatnam1102,项目名称:wp-content,代码行数:17,代码来源:menu-walker.php


示例20: wpex_post_entry_classes

 function wpex_post_entry_classes($classes)
 {
     // Post Data
     global $post;
     $post_id = $post->ID;
     $post_type = get_post_type($post_id);
     // Only add classes to standard post type
     if ($post_type !== 'post') {
         return $classes;
     }
     // Main vars
     $blog_style = 'large-image';
     $grid_columns = 'span_1_of_2';
     $admin_blog_style = wpex_option('blog_style', 'large-image');
     $admin_grid_columns = wpex_option('blog_grid_columns', '2');
     // Main Classes
     $classes[] = 'blog-entry clr';
     // Blog Styles
     if (is_category()) {
         $term = get_query_var('cat');
         $term_data = get_option("category_{$term}");
         $term_style = '';
         $grid_columns = '';
         if ($term_data) {
             if (isset($term_data['wpex_term_style'])) {
                 $term_style = $term_data['wpex_term_style'] !== '' ? $term_data['wpex_term_style'] . '' : '';
             }
             if (isset($term_data['wpex_term_grid_cols'])) {
                 $grid_columns = $term_data['wpex_term_grid_cols'] !== '' ? $term_data['wpex_term_grid_cols'] . '' : '';
             }
         }
         $blog_style = $term_style !== '' ? $term_style . '-entry-style' : $admin_blog_style;
         $grid_columns = $grid_columns !== '' ? $grid_columns : $admin_grid_columns;
     } else {
         $blog_style = $admin_blog_style;
         $grid_columns = $admin_grid_columns;
     }
     // Add columns for grid style entries
     if ($blog_style == 'grid-entry-style') {
         $classes[] = wpex_grid_class($grid_columns);
     }
     // Return classes based on admin setting
     $classes[] = $blog_style;
     return $classes;
 }
开发者ID:nhatnam1102,项目名称:wp-content,代码行数:45,代码来源:post-classes.php



注:本文中的wpex_option函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP wpex_pagination函数代码示例发布时间:2022-05-23
下一篇:
PHP wpex_image_crop_locations函数代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap