WordPress Category Question
I had a similar question, and the solution was to add a function in functions.php. How to get current_cat in navbar, in single post
I had a similar question, and the solution was to add a function in functions.php. How to get current_cat in navbar, in single post
If you need to use a custom menu, then what you’re doing is probably the only way. “Select All” in the Categories meta box on the admin menus screen, “Add to menu”, and then reorder the category items as you like. But if you just want an automatic list of categories, then why not just … Read more
Try putting the id first. from the codex: For performance reasons, it is not a good idea to start your permalink structure with the category, tag, author, or postname fields. The reason is that these are text fields, and using them at the beginning of your permalink structure it takes more time for WordPress to … Read more
Are you absolutely sure ff_show is correct slug? I have suspicions about that underscore… category is not valid query argument at all, it is probably simply discarded. Had you tried this query with id instead of slug? cat argument. Edit. Wait, you are trying to query custom taxonomy? Category arguments have no relation to it … Read more
You need to put it in an array. <?php if(is_category(array(1,2,3,4)) ?>
First make sure you’ve set your posts per page to 6 in the Reading settings – as I can see you’re displaying 2 columns of 3 posts. Then you need to add the page variable to the query_posts attributes, by adding this before you query posts: $paged = (get_query_var(‘page’)) ? get_query_var(‘page’) : 1; and then … Read more
Hi @Raffaele: The function wp_get_object_terms(…) can provide you with the information you need. I’ve written a has_category($post_id) function that can be used in the loop like this: <?php while ( have_posts() ) : the_post(); ?> <?php if (has_category($post->ID)): ?> <p><?php the_title(); ?></p> <?php endif; ?> <?php endwhile; ?> And here is the has_category() function: <?php … Read more
There is category__not_in (see Category Parameters), but I am not entirely sure if it will work properly if you try to include and exclude category at the same time. If you want to skip some category with your current arguments I think it would be better to not include it in $category_ids array.
You could do something like this: <ul> <?php wp_list_categories(‘order_by=ID&title_li=&include=4,5,6,7,8,9,10’); wp_list_categories(‘order_by=ID&title_li=$include=72’); wp_list_categories(‘order_by=ID&title_li=&include=11,12,13,14,15,16,17, 18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41′); ?> </ul> Just listing them in order for the include arg won’t help you since that only goes into the WHERE clause, not into the ORDER BY clause of the SQL query.
This problem has been resolved by use of the plugin ‘Remove Blog Slug’ available at buddydev.com/plugins/remove-blog-slug-plugin/.