Articles of categories

wp_list_categories, Add class to all list items with children

I’m using wp_list_categories(); to show a list of all the terms within a custom taxonomy but I need to style list items that have children differently to those that don’t. Is there a way, PHP or jQuery, that I can give all parent elements a special class?

Different background-image by category

I am trying to put different body background-image for each category. body { background-color: #000; background-image: url(img/bg.png); background-repeat: no-repeat; background-position: center top; font-size: 14px; color: #555; font-family: Arial, Helvetica, Verdana, sans-serif; } I only want different background-image: url(img/bg.png); for each catecory. I found one possible method. It’s like that: <link rel=”stylesheet” href=”” type=”text/css” media=”screen,projection” /> […]

Add classname to the_category() function?

is it possible to use add_filter or something similar to add the slug of the category as classname to the the_category() function? Right now when using the_category() the output looks like this … <ul class=”post-categories”> <li> <a href=”http://mysite.com/something” title=”” rel=”category tag”>News</a> </li> </ul> Is it possible to somehow get this … <ul class=”post-categories”> <li class=”category-news”> […]

How to show related posts by category

In my gallery site i want to show other pictures under the current picture (in single post). I seen more codes but it i asks to specify the category, but i dont want want specify the category manually in the code I want the code itself to get the category ID or name.It would be […]

Update term count using a callback function

With the wp_update_term_count_now, how can I use the update_count_callback to specify my own count. I need to include counts from another database that the current database category is able to display. The current categories may not have any posts in them, but are able to be viewed showing posts from the same category in another […]

Add Category Taxonomy Support to Custom Post Type

I’m writing some code that makes extensive use of custom post types– and I’m looking for a means of programatically adding a category to a defined custom post type, and then accessing its category ID. I had a poke around but I can’t seem to find a robust means of achieving this – wp_create_category would […]

wp_list_categories exclude not working

I’m try to exclude a specific category from a list of categories that a custom post has (in this case ‘Uncategorized’ – ID: 1). I’ve tried exclude: wp_list_categories([ ‘include’ => wp_list_pluck(get_the_category(), ‘term_id’), ‘title_li’ => ”, ‘exclude’ => 1 ]); But it still appears. How can I make sure it never appears, even if a post […]

How do I make the category template display full posts instead of partial posts?

I’m using WordPress 3.0.1 with the Twenty Ten theme. I’m trying to change the way the posts in the Category view are displayed (i.e. by going to a url like mywebsite.com/category/mycategory). Currently the posts in the Category view just show the first part of a post, but I’d like to change that so it shows […]

Filter posts under multiple categories?

How do I filter the posts by multiple categories? For example, if some of my posts are categorized under just apples and some as just oranges and some both, how would I filter the results to show only posts marked under both apples and oranges? In other words, I don’t want the results to list […]

Combine Multiple Categories Into One URL Slug

I have a WordPress website with 20+ categories. To make it easier to navigate I want to decrease the categories, but at the same time keep the original categories. In other words I want to be able to query multiple categories with a category group or a virtual slug. Example categories: /category/apples/ /category/pears/ /category/bananas/ I […]