WordPress.org

Ready to get started?Download WordPress

Forums

Post Category Index Generator
show post count (3 posts)

  1. windwww
    Member
    Posted 1 year ago #

    In
    function pcig_generate_category_tree_array($category_id,$params)

    add after the line: if($show_category){

    $countPosts = null;
    			if(in_array("count",$params['show'])){
    				$countPost = " (" . $subcategory->count .") ";
    			}
    			if(in_array("subcategory_name",$params['links'])){
    				$subcategory_name = "<a href=\"".get_category_link($subcategory->term_id)."\" class=\"pcig-subcategory-link\" title=\"".$subcategory->name."\">".$subcategory->name.$countPost."</a>";
    			}else{
    				$subcategory_name = $subcategory->name.$countPosts;
    			}

    do the same for
    function pcig_generate_category_list_array($category_id,$params)

    the the short code
    use show=count to display the number of posts within the subcategory.

    http://wordpress.org/extend/plugins/post-category-index-generator/

  2. windwww
    Member
    Posted 1 year ago #

    amendment:

    $countPosts = null;
    			if(in_array("count",$params['show'])){
    				$countPosts = " (" . $subcategory->count .") ";
    			}
    			if(in_array("subcategory_name",$params['links'])){
    				$subcategory_name = "<a href=\"".get_category_link($subcategory->term_id)."\" class=\"pcig-subcategory-link\" title=\"".$subcategory->name."\">".$subcategory->name.$countPosts ."</a>";
    			}else{
    				$subcategory_name = $subcategory->name.$countPosts;
    			}
  3. Boris_C
    Member
    Posted 1 year ago #

    Hi windwww,

    This is great, how can I do this in order to show the date?

    Best

    Boris

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags