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

PHP get_cat_name函数代码示例

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

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



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

示例1: category_subnav

/**
 * Subnav of current category's topmost parent's children, outputted as widget
 * todo - make it an actual widget
 */
function category_subnav()
{
    global $post;
    if (is_category() || is_single()) {
        $categories = get_the_category();
        $category = array_shift($categories);
        $top_parent = $category->category_parent ? $category->category_parent : $category->cat_ID;
        $top_parent_name = get_cat_name($top_parent);
        $top_parent_children = wp_list_categories(array('child_of' => $top_parent, 'title_li' => '', 'echo' => 0));
        if ($top_parent_children != '<li>No categories</li>') {
            ?>
            <nav class="widget widget-subnav">
                <h1 class="widget-title nav-title">'<?php 
            echo $top_parent_name;
            ?>
</h1>
                    <div class="widget-content">
                        <ul class="menu menu-secondary">
                            <?php 
            echo $top_parent_children;
            ?>
                        </ul>
                    </div>
            </nav>
     <?php 
        }
    }
}
开发者ID:leahjs,项目名称:my-web-development-flight,代码行数:32,代码来源:navigation.php


示例2: widget

    /** @see WP_Widget::widget */
    function widget($args, $instance)
    {
        extract($args);
        $category_id = $instance['category_id'];
        echo $before_widget;
        ?>
		<?php 
        echo "<h2>" . get_cat_name($category_id) . "</h2>";
        ?>
		<ul>
<?php 
        global $post;
        $args = array('category' => $category_id, "numberposts" => -1, "orderby" => "title", "order" => "ASC");
        $myposts = get_posts($args);
        foreach ($myposts as $post) {
            setup_postdata($post);
            ?>
	<li><a href="<?php 
            the_permalink();
            ?>
"><?php 
            the_title();
            ?>
</a></li>
<?php 
        }
        ?>
</ul>
<?php 
        wp_reset_query();
        echo $after_widget;
    }
开发者ID:besimhu,项目名称:legacy,代码行数:33,代码来源:category-listing-widget.php


示例3: wolf_breadcrumbs_get_category_links

function wolf_breadcrumbs_get_category_links($page_id = '')
{
    if (strlen(trim($page_id)) > 0) {
        $cat_name = '';
        $cat_url = '';
        $cats = get_the_category($page_id);
        if (count($cats) > 0) {
            $cat = $cats[0];
            $cat_id = $cat->cat_ID;
            $cat_name = $cat->cat_name;
            $cat_url = get_category_link($cat_id);
        }
    } else {
        if (single_tag_title('', false == '')) {
            $cat_id = get_query_var('cat');
            $cat_name = get_cat_name($cat_id);
            $cat_url = get_category_link($cat_id);
        } else {
            $cat_url = get_tag_link(get_query_var('tag_id'));
            $cat_name = single_tag_title('', false);
        }
    }
    $cat_link = '<li>';
    $cat_link .= '<a href="' . $cat_url . '" itemprop="url"><span itemprop="title">' . $cat_name . '</span></a>';
    if (strlen(trim($page_id)) > 0 && strlen(trim($cat_name)) > 0) {
        $cat_link .= '<span class="divider">/</span>';
    }
    $cat_link .= '</li>';
    return $cat_link;
}
开发者ID:joffcrabtree,项目名称:Wolf,代码行数:30,代码来源:breadcrumbs.php


示例4: widget

    function widget($args, $instance)
    {
        extract($args, EXTR_SKIP);
        $category_id = empty($instance['category_id']) ? 1 : $instance['category_id'];
        $use_cat_title = empty($instance['use_cat_title']) ? 0 : $instance['use_cat_title'];
        $hide_empty_cats = empty($instance['hide_empty_cats']) ? 0 : $instance['hide_empty_cats'];
        $show_post_count = empty($instance['show_post_count']) ? 0 : $instance['show_post_count'];
        $title_link = empty($instance['title_link']) ? 0 : $instance['title_link'];
        $excluded = empty($instance['excluded']) ? '' : $instance['excluded'];
        $sub_subs = empty($instance['sub_subs']) ? 0 : $instance['sub_subs'];
        $dropdown = empty($instance['dropdown']) ? 0 : $instance['dropdown'];
        $post_is_parent = empty($instance['post_is_parent']) ? 0 : $instance['post_is_parent'];
        $dropdown_text = empty($instance['dropdown_text']) ? __('Select Sub-category', 'sub-categories-widget') : $instance['dropdown_text'];
        $list_order = empty($instance['list_order']) ? 0 : $instance['list_order'];
        if ($post_is_parent) {
            $category = get_the_category();
            $category_id = $category ? $category[0]->cat_ID : 1;
        }
        if ($use_cat_title) {
            $title = apply_filters('widget_title', get_cat_name($category_id), $instance, $this->id_base);
        } else {
            $title = apply_filters('widget_title', empty($instance['title']) ? __('Sub Categories', 'sub-categories-widget') : $instance['title'], $instance, $this->id_base);
        }
        $parent = $sub_subs == 1 ? 'child_of' : 'parent';
        $order = $list_order == 1 ? 'DESC' : 'ASC';
        $no_sub_text = '<p>' . __('No sub-categories', 'sub-categories-widget') . '</p>';
        $subs = wp_list_categories(array($parent => $category_id, 'hide_empty' => $hide_empty_cats, 'show_count' => $show_post_count, 'exclude' => $excluded, 'title_li' => null, 'show_option_none' => '', 'echo' => 0, 'orderby' => 'ID', 'order' => $order));
        if ($post_is_parent == 0 || $post_is_parent == 1 && !empty($subs)) {
            echo $before_widget;
            if ($title_link) {
                echo $before_title . '<a href="' . get_category_link($category_id) . '">' . $title . '</a>' . $after_title;
            } else {
                echo $before_title . $title . $after_title;
            }
            if ($dropdown == 0) {
                if (!empty($subs)) {
                    echo '<ul>' . $subs . '</ul>';
                } else {
                    echo $no_sub_text;
                }
            } else {
                $subs = wp_dropdown_categories(array('id' => 'sub-cat-' . $this->number, 'show_option_none' => $dropdown_text, $parent => $category_id, 'hide_empty' => $hide_empty_cats, 'show_count' => $show_post_count, 'exclude' => $excluded, 'hide_if_empty' => true, 'echo' => false, 'orderby' => 'ID', 'order' => $order));
                if (!empty($subs)) {
                    echo $subs;
                    echo '<script type="text/javascript">
						/* <![CDATA[ */
						var dropdown' . $this->number . ' = document.getElementById("sub-cat-' . $this->number . '");
						function onSubCatChange() {
						if (dropdown' . $this->number . '.options[dropdown' . $this->number . '.selectedIndex].value > 0) { location.href = "' . get_option('home') . '?cat="+dropdown' . $this->number . '.options[dropdown' . $this->number . '.selectedIndex].value; }
						}
						dropdown' . $this->number . '.onchange = onSubCatChange;
						/* ]]> */
						</script>';
                } else {
                    echo $no_sub_text;
                }
            }
            echo $after_widget;
        }
    }
开发者ID:phongvan212,项目名称:kinhte,代码行数:60,代码来源:sub-categories-widget.php


示例5: my_rest_prepare_post

function my_rest_prepare_post($data, $post, $request)
{
    $_data = $data->data;
    $thumbnail_id = get_post_thumbnail_id($post->ID);
    $thumbnail = wp_get_attachment_image_src($thumbnail_id);
    $_data['featured_image_thumbnail_url'] = $thumbnail[0];
    $categories = get_categories();
    $_data['all_categories'] = $categories;
    unset($_data['author']);
    unset($_data['comment_status']);
    unset($_data['ping_status']);
    unset($_data['modified']);
    unset($_data['modified_gmt']);
    unset($_data['date_gmt']);
    unset($_data['guid']);
    unset($_data['slug']);
    unset($_data['sticky']);
    $tags_arr = array();
    foreach ($_data['tags'] as $tagID) {
        $tag = get_tag($tagID);
        // add name field to the array
        $tags_arr[] = array('ID' => $tagID, 'name' => $tag->name);
    }
    $_data['tags'] = $tags_arr;
    // assign the new tags array to the JSON field
    $categories_arr = array();
    foreach ($_data['categories'] as $catID) {
        // add name field to the array
        $categories_arr[] = array('ID' => $catID, 'name' => get_cat_name($catID));
    }
    $_data['categories'] = $categories_arr;
    // assign the new tags array to the JSON field
    $data->data = $_data;
    return $data;
}
开发者ID:bgauchan,项目名称:sourgems-wp-theme,代码行数:35,代码来源:functions.php


示例6: Grafik_Functions_Shortcode_TypeCategories

function Grafik_Functions_Shortcode_TypeCategories($atts, $content = '')
{
    global $wp_query;
    global $GRAFIK_MODE;
    $callback_output = '';
    $a = shortcode_atts(array('type' => 'post', 'class' => '', 'id' => ''), $atts, 'TypeCategories');
    // Construct the query...
    $callback_query = new WP_Query(array('post_type' => $a['type'], 'posts_per_page' => -1));
    // Loop the query...
    $callback_categories = array();
    if ($callback_query->have_posts()) {
        while ($callback_query->have_posts()) {
            $callback_query->the_post();
            $callback_post = get_post();
            $callback_postcats = wp_get_post_categories($callback_post->ID);
            foreach ($callback_postcats as $key => $val) {
                $callback_categories[$val]++;
            }
        }
        wp_reset_postdata();
    } else {
        $callback_output .= '<span class="empty-message">' . $a['empty_msg'] . '</span>';
    }
    // Loop the results...
    foreach ($callback_categories as $key => $val) {
        $callback_output .= '<li class="ge-typecategories-item">' . '<a href="' . esc_url(get_category_link($key)) . '" class="ge-typecategories-link">' . '<span class="ge-typecategories-name">' . get_cat_name($key) . '</span>' . '<span class="ge-typecategories-count">' . $val . '</span>' . '</a>' . '</li>';
    }
    if (empty($callback_output)) {
        return '';
    }
    return '<div class="ge-typecategories-container' . (empty($a['class']) ? null : ' ' . $a['class']) . '"' . (empty($a['id']) ? null : ' id="' . $a['id'] . '"') . '>' . '<div class="ge-typecategories-content">' . $content . '</div>' . '<ul class="ge-typecategories-list">' . $callback_output . '</ul>' . '</div>';
}
开发者ID:GrafikMatthew,项目名称:Grafik-Engine-Beta,代码行数:32,代码来源:TypeCategories.php


示例7: form

 function form($instance)
 {
     $default = array('title' => 'Widget Demo', 'number_post' => '5', 'current_category' => '');
     // Gộp các giá trị của $default vào $instance để nó trở thành giá trị mặc định
     $instance = wp_parse_args((array) $instance, $default);
     // Gán giá trị ($instance['title'] cho $title (khởi tạo biến $title))
     $title = esc_attr($instance['title']);
     $number_post = esc_attr($instance['number_post']);
     // Get title
     echo "<p>Title:</p>";
     echo "<p><input type=\"text\" name=\"" . $this->get_field_name('title') . "\" value=\"" . $title . "\" /></p>";
     // Select category
     $all_categories = get_all_category_ids();
     echo "<p>Category:</p>";
     echo "<p><select id=\"" . $this->get_field_id('current_category') . "\" name=\"" . $this->get_field_name('current_category') . "\" >";
     foreach ($all_categories as $category) {
         if ($category == $instance['current_category']) {
             echo "<option value=\"" . $category . "\" selected=\"selected\">" . get_cat_name($category) . "</option>";
         } else {
             echo "<option value=\"" . $category . "\">" . get_cat_name($category) . "</option>";
         }
     }
     echo "</select></p>";
     // Get count
     echo "<p>Show number posts:</p>";
     echo "<p><input type=\"text\" name=\"" . $this->get_field_name('number_post') . "\" value=\"" . $number_post . "\" /></p>";
 }
开发者ID:thinh9012,项目名称:Wordpress,代码行数:27,代码来源:widgetqthinh.php


示例8: widget

 /**
  * Front-end display of widget.
  *
  * @see WP_Widget::widget()
  * @since 1.0.0
  *
  * @param array $args     Widget arguments.
  * @param array $instance Saved values from database.
  */
 function widget($args, $instance)
 {
     // Extract args
     extract($args, EXTR_SKIP);
     $category_id = empty($instance['category_id']) ? 1 : $instance['category_id'];
     $post_num = empty($instance['post_num']) ? 5 : $instance['post_num'];
     $use_cat_title = empty($instance['use_cat_title']) ? 0 : $instance['use_cat_title'];
     $title_link = empty($instance['title_link']) ? 0 : $instance['title_link'];
     if ($use_cat_title) {
         $title = apply_filters('widget_title', get_cat_name($category_id), $instance, $this->id_base);
     } else {
         $title = apply_filters('widget_title', empty($instance['title']) ? __('Listen to Broadcast', 'wpsp') : $instance['title'], $instance, $this->id_base);
     }
     echo $before_widget;
     if ($title_link) {
         echo $before_title . '<a href="' . get_category_link($category_id) . '">' . $title . '</a>' . $after_title;
     } else {
         echo $before_title . $title . $after_title;
     }
     global $post;
     $args = array();
     $defaults = array('post_type' => 'post', 'posts_per_page' => (int) $post_num, 'post__not_in' => array($post->ID), 'tax_query' => array('relation' => 'AND', array('taxonomy' => 'post_format', 'field' => 'slug', 'terms' => array('post-format-audio')), array('taxonomy' => 'category', 'field' => 'term_id', 'terms' => array($category_id))));
     $args = wp_parse_args($args, $defaults);
     extract($args);
     $custom_query = new WP_Query($args);
     if ($custom_query->have_posts()) {
         while ($custom_query->have_posts()) {
             $custom_query->the_post();
             get_template_part('partials/content', 'radio');
         }
         wp_reset_postdata();
     }
     echo $after_widget;
     return $instance;
 }
开发者ID:sptheme,项目名称:klahan9,代码行数:44,代码来源:listen-broadcast-widget.php


示例9: get_tab_posts

 /**
  * Generates the tabs for posts
  *
  * @param  array $content
  * @return array
  */
 public static function get_tab_posts($content)
 {
     // Set up date filter
     self::date_range($content['from_date'], $content['to_date']);
     // Set up results array
     $results = array('title' => '{Needs to be changed}', 'tabs' => array());
     // Get posts
     foreach ($content['categories'] as $cat_id) {
         // If parent skip
         if (self::is_parent($cat_id)) {
             continue;
         }
         // Get posts
         $query_results = query_posts(array('cat' => $cat_id, 'orderby' => 'date', 'order' => 'desc', 'posts_per_page' => $content['posts_number'] === 'All' ? self::$result_limit[$content['layout']] : 1));
         // Remove filter
         wp_reset_query();
         remove_filter('posts_where', array('Posts_Widget', 'date_filter'));
         // Get custom fields
         $cat_name = get_cat_name($cat_id);
         $results['tabs'][$cat_name] = array();
         foreach ($query_results as $result) {
             $result->fields = (object) get_fields($result->ID);
             $results['tabs'][$cat_name][] = $result;
         }
     }
     return $results;
 }
开发者ID:troubletribbles,项目名称:dr_bootstrap,代码行数:33,代码来源:posts_widget.php


示例10: widget

 /**
  * Front-end display of widget.
  *
  * @see WP_Widget::widget()
  * @since 1.0.0
  *
  * @param array $args     Widget arguments.
  * @param array $instance Saved values from database.
  */
 function widget($args, $instance)
 {
     // Extract args
     extract($args, EXTR_SKIP);
     $category_id = empty($instance['category_id']) ? 1 : $instance['category_id'];
     $use_cat_title = empty($instance['use_cat_title']) ? 0 : $instance['use_cat_title'];
     $hide_empty_cats = empty($instance['hide_empty_cats']) ? 0 : $instance['hide_empty_cats'];
     $show_post_count = empty($instance['show_post_count']) ? 0 : $instance['show_post_count'];
     $title_link = empty($instance['title_link']) ? 0 : $instance['title_link'];
     if ($use_cat_title) {
         $title = apply_filters('widget_title', get_cat_name($category_id), $instance, $this->id_base);
     } else {
         $title = apply_filters('widget_title', empty($instance['title']) ? __('Sub Categories', 'wpsp') : $instance['title'], $instance, $this->id_base);
     }
     $no_sub_text = '<p>' . __('No sub-categories', 'wpsp') . '</p>';
     $subs = wp_list_categories(array('child_of' => $category_id, 'hide_empty' => $hide_empty_cats, 'show_count' => $show_post_count, 'title_li' => null, 'show_option_none' => '', 'echo' => 0));
     echo $before_widget;
     if ($title_link) {
         echo $before_title . '<a href="' . get_category_link($category_id) . '">' . $title . '</a>' . $after_title;
     } else {
         echo $before_title . $title . $after_title;
     }
     if (!empty($subs)) {
         echo '<ul>' . $subs . '</ul>';
     } else {
         echo $no_sub_text;
     }
     echo $after_widget;
     return $instance;
 }
开发者ID:sptheme,项目名称:klahan9,代码行数:39,代码来源:sub-categories-widget.php


示例11: widget

    function widget($args, $advcat_instance)
    {
        extract($args);
        $title = apply_filters('widget_title', empty($advcat_instance['title']) ? 'Categories' : $advcat_instance['title'], $advcat_instance, $this->id_base);
        $numCols = isset($advcat_instance['numCols']) ? $advcat_instance['numCols'] : false;
        if (!($cats = $advcat_instance["cats"])) {
            $cats = '';
        }
        $advcat_widget = null;
        $advcat_widget = new WP_Query($advcat_args);
        echo $before_widget;
        echo '<div id="adv-recent-cats" class="widget-inner">';
        // Widget title
        if ($advcat_instance["title"] != '') {
            echo $before_title;
            echo $advcat_instance["title"];
            echo $after_title;
        }
        // Post list in widget
        if ($cats != '') {
            echo "<ul class='row'>\n";
            foreach ($cats as $cat) {
                if ($numCols) {
                    echo '<li class="advwidget-item col-xs-6">';
                } else {
                    echo '<li class="advwidget-item col-xs-12">';
                }
                // Get the ID of a given category
                $category_id = $cat;
                // Get the URL of this category
                $category_link = get_category_link($category_id);
                // Get te Name of this category
                $category_name = get_cat_name($category_id);
                ?>
				<!-- Print a link to this category -->
				<a href="<?php 
                echo esc_url($category_link);
                ?>
"><?php 
                echo $category_name;
                ?>
</a>
				</li>
			<?php 
            }
            //end for each
            ?>
		<?php 
            //endif;
            ?>
	
		<?php 
            wp_reset_query();
            echo "</ul>\n";
        }
        //end if array not empty
        echo '</div>';
        echo $after_widget;
    }
开发者ID:pronoSoupe,项目名称:pronobo_soupe,代码行数:59,代码来源:advanced-categories-widget.php


示例12: widget

    function widget($args, $instance)
    {
        // outputs the content of the widget
        extract($args);
        $this->category_JS();
        $title = apply_filters('widget_title', $instance['title']);
        if ($args['id'] == 'sidebar-footerwidgetarea') {
            $footer_width = 'span' . circleflip_calculate_widget_width();
        } else {
            $footer_width = '';
        }
        ?>
			 
			 
			<li class="categoryCount widget customWidget <?php 
        echo esc_attr($footer_width);
        ?>
">
			 	<?php 
        if ($title != null) {
            ?>
			 		<div class="widgetDot"></div>
					<h3 class="widgetTitle grid2"><?php 
            echo esc_html($title);
            ?>
</h3>
				
				<?php 
        }
        $category_ids = get_terms('category', array('fields' => 'ids', 'get' => 'all'));
        foreach ($category_ids as $cat_id) {
            $cat_name = get_cat_name($cat_id);
            if ($cat_name != 'Uncategorized') {
                ?>
					<p class="widgetcategory_with_count  textwidget">
					<span class="left"><a href="<?php 
                echo esc_url(get_category_link($cat_id));
                ?>
"><?php 
                echo esc_html($cat_name);
                ?>
</a></span>
					<?php 
                $postsInCat = get_term_by('name', $cat_name, 'category');
                $postsInCat = $postsInCat->count;
                ?>
 <span class="right"><?php 
                echo '(' . $postsInCat . ')';
                ?>
</span>
					</p> 
				 <?php 
            }
        }
        ?>
			</li>
			<?php 
    }
开发者ID:purgesoftwares,项目名称:purges,代码行数:58,代码来源:categories_with_count.php


示例13: get_video_category_link

 public static function get_video_category_link()
 {
     $category_ids = get_all_category_ids();
     foreach ($category_ids as $cat_id) {
         if (!strcmp(get_cat_name($cat_id), "video")) {
             echo get_category_link($cat_id);
         }
     }
 }
开发者ID:natematias,项目名称:UniLives-Videostream-Widget-Plugin,代码行数:9,代码来源:unilives-videostream.php


示例14: list_type

function list_type($category, $type)
{
    echo "<h1>" . get_cat_name(get_category_by_slug($category)->cat_ID) . ":</h1>\n";
    $files = new WP_Query(array('category_name' => $category, 'post_type' => $type, 'order' => 'ASC', 'orderby' => 'title'));
    while ($files->have_posts()) {
        $files->the_post();
        echo "<p>" . the_post_thumbnail() . "<strong>" . get_the_title() . "</strong>: " . get_the_content() . "</p>\n";
    }
}
开发者ID:cael421,项目名称:arbiter-prime,代码行数:9,代码来源:functions.php


示例15: constantTest

 protected function constantTest()
 {
     $post_id_1 = 0;
     $time = microtime(true);
     for ($i = 0; $i < $this->runNumber; $i++) {
         get_cat_name(1);
     }
     $time = microtime(true) - $time;
     $this->enterResult($time);
 }
开发者ID:AkimBolushbek,项目名称:wordpress-soc-2007,代码行数:10,代码来源:CategoryFunctions.php


示例16: getCategoryNewsTitle

 public function getCategoryNewsTitle()
 {
     if (isset($this->categoryNewsTitle)) {
         return $this->categoryNewsTitle;
     }
     if ($this->isCategoryNewsId()) {
         return $this->categoryNewsTitle = get_cat_name($this->getCategoryNewsId());
     }
     return $this->categoryNewsTitle = "";
 }
开发者ID:ktstudio,项目名称:WPFW-Skeleton,代码行数:10,代码来源:kt_zzz_theme_model.inc.php


示例17: find_category_by_name

function find_category_by_name($name)
{
    $cat = null;
    $category_ids = get_all_category_ids();
    foreach ($category_ids as $cat_id) {
        if (!strcmp(get_cat_name($cat_id), "Blog")) {
            $cat = $cat_id;
        }
    }
    return $cat;
}
开发者ID:natematias,项目名称:Mistylook-Hackage,代码行数:11,代码来源:functions.php


示例18: getCategories

 public function getCategories($theCategories)
 {
     if (!$theCategories) {
         return array();
     }
     $array = array();
     foreach ($theCategories as $category) {
         $params = array('name' => get_cat_name($category->cat_ID), 'link' => get_category_link($category));
         $array[] = new Category($params + get_object_vars($category));
     }
     return $array;
 }
开发者ID:laiello,项目名称:cootheme2,代码行数:12,代码来源:PostDataHelper.php


示例19: mycatlist_func

function mycatlist_func($atts, $content = null)
{
    $atts = shortcode_atts(array('cat' => '0'), $atts);
    $catid = $atts['cat'];
    add_filter('post_limits', 'cat_post_limit');
    global $myOffset;
    $myOffset = 1;
    $temp = $wp_query;
    $wp_query = null;
    $wp_query = new WP_Query();
    $wp_query->query('cat=' . $catid . '&offset=' . $myOffset . '&posts_per_page=' . intval(get_option('posts_per_page')) . '&paged=' . $paged);
    $pages = $wp_query->max_num_pages;
    ob_start();
    ?>

			<h2> <?php 
    echo get_cat_name($catid);
    ?>
 </h2>
			<ul>
			<?php 
    while ($wp_query->have_posts()) {
        $wp_query->the_post();
        ?>

			 <li><a href="<?php 
        the_permalink();
        ?>
" rel="bookmark" title="<?php 
        the_title();
        ?>
"><?php 
        the_title();
        ?>
</a></li>
			<?php 
    }
    ?>

			
			</ul>
			<div class="navigation"><?php 
    echo mukesh_pagination($pages);
    ?>
</div>
			<?php 
    $myoutput = ob_get_contents();
    ob_end_clean();
    $wp_query = null;
    $wp_query = $temp;
    remove_filter('post_limits', 'cat_post_limit');
    return $myoutput;
}
开发者ID:Bakerpedia,项目名称:Developement_WPengine,代码行数:53,代码来源:list-category-posts-with-pagination.php


示例20: catDropDown

function catDropDown($thisCatID)
{
    if ($thisCatID[1] == "0") {
        $thisCatID[1] = 1;
    }
    $category_ids = get_all_category_ids();
    echo '<OPTION  ' . (isset($thisCatID[0]) && is_null($thisCatID[0]) ? 'selected' : '') . '  VALUE=NULL>Not in Use</OPTION>';
    foreach ($category_ids as $cat_id) {
        $cat_name = get_cat_name($cat_id);
        echo '<OPTION  ' . selected(true, in_array($cat_id, $thisCatID), false) . '  VALUE="' . $cat_id . '">' . $cat_name . '</OPTION>';
    }
}
开发者ID:adams0917,项目名称:woocommerce_eht,代码行数:12,代码来源:options.php



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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