First of all, let’s say we have a “Secrets” category, and we want to hide all the posts in this one from the blog.
Now, we have to find the ID of “Secrets”.
- Method 1:
- Log in to your wordpress blog and go to Posts → Categories.
- Search for your category’s name.
- Look at the URL, there is the “tag_ID” param, for example tag_ID=250. So, the ID is 250.
- Method 2:
- mysql -u <user> -p <db>, insert your password
- Execute: select wp_terms.term_id from wp_terms, wp_term_taxonomy where wp_terms.name = “Secrets” AND wp_terms.term_id = wp_term_taxonomy.term_id AND wp_term_taxonomy.taxonomy = “category”;
Now, edit your theme’s index.php and search for the start of the loop:
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
Put this line just before:
<?php query_posts(‘cat=-250’); ?>
And that’s all.
0 Comments Leave a comment