Problem with category number

In my blog there is two post (private) but in the sidebar in “senza-categoria” list number is 16 but I don’t have 16 post!!

I try to:

  • clear cache
  • remove e re-inser category widget
  • delete Employees list (category in menu Employees is the same of category Post)

How can i do? thank

Hello there,

That link displaying “not found”. Is it associated to Employees entries? If so, to enable category archive for employees, try adding the below function to your child theme’s functions.php file. Or you can use a functionality plugin like Code Snippets if you aren’t running a child theme.

    function sydney_child_include_employees_archive($query) {
    	if ( !is_admin() && $query->is_main_query() ) {
    	    if ( $query->is_archive() ) {
    			$query->set('post_type', array( 'post', 'employees' ) );
    		}
    	}
    }
    add_action('pre_get_posts','sydney_child_include_employees_archive'); 

Regards,
Kharis

No… sorry for my bad english…problem is not enployees… you see not found only because the post are private.

The problem is the number in the category list (view in sidebar number 16?). I don’t have 16 employees or 16 posts…

up… can you help me?.. I don’t solve it, thank

Hello there,

The first thing to do is flushing permalink structure by going to Settings > Permalinks; then just hit the save button. Then go to post menu and ensure there’s at least one publicly published post.

Regards,
Kharis

Thank you but setting permalink don’t work but… right now I found out that I was counting the sample data contained in Service and Testimonial, so I solved the problem of the number 16! And now you score me 0.

But … I also realized that I do not mark the other categories of posts, should appear other items over “without category”

How can I do? In fuction I add function below putting only"post" but don’t work…

    function sydney_child_include_employees_archive($query) {
        	if ( !is_admin() && $query->is_main_query() ) {
        	    if ( $query->is_archive() ) {
        			$query->set('post_type', array( 'post') );
        		}
        	}
        }
        //add_action('pre_get_posts','sydney_child_include_employees_archive');

This line of code make the function do nothing. You need to remove the double slash.

add_action('pre_get_posts','sydney_child_include_employees_archive');

Regards,
Kharis

function sydney_child_include_employees_archive($query) {
        	if ( !is_admin() && $query->is_main_query() ) {
        	    if ( $query->is_archive() ) {
        			$query->set('post_type', array( 'post') );
        		}
        	}
        }
      add_action('pre_get_posts','sydney_child_include_employees_archive');

Sorry… don’t work! I want to specify that employees do not center anything with my blog … I have only simple articles and that’s it.
The categories should be seen with or without this function. Maybe there are problems in the widget? I would urgently need to solve, thank you

Up! hel me please! thank you