Articles of categories

Include template before a loop

This is my category / archive page i want to include a template before loop but i cant get posts based on category, it showing latest post only on every page. when i removed this line before the loop <?php include( TEMPLATEPATH . ‘/includes/tb/hot_posts.tpl.php’ ); ?> it work smoothly, but i need this template before […]

anything like add_meta_box for categories?

I want to add few custom fields to categories. So I am looking for something like add_meta_box but for categories. Is there any WP function like that for categories?

Query only Posts from Both of Two Category?

I have 3 categories, 1.OnGoing projects(cat id=’5′) 2.Completed Projects(cat id=’6′) 3.Upcoming Projects(cat id=’7′) and also i have another 2 categories:(Not a Sub Category) chennai (cat id=’10’) Dubai (cat id=’11) How to get the post from “OnGoing Projects” with “Chennai” category?(I like to Display -> OnGoing Projects on Chennai.) I have tried the following code: <?php […]

Get the name an the description of a link category

I have a link category with the id $id=23; and the slug $slug=friends;. I managed to read all links from that category using get_bookmarks($id). Now I also want to use the name and the description ob the link category. How geht I get these values? I tried for example: $cat = get_the_category($id); $output .= “<p>Description: […]

WordPress list posts from sub categories

has anyone an ideea how can you do something like this: So if the user is in a category, let’s say Mainand this categories has some subcategories and I want to list them and also list the posts, something like this: Sub category name 1 -POST 1 -POST 2 Sub category name 2 -POST 1 […]

Show category children, one level

I am coding a pretty complex wordpress site (at least, taxonomically speaking), and i need to display a list of categories, children of a parent category, but I am struggling with getting the code to do this. I tried doing something like: <?php $cat = get_query_var(‘cat’); $categories= get_categories(‘hide_empty=0&parent=1&child_of=’.$cat); foreach ($categories as $category) { $mycat .= […]

How to get post category title within the loop?

I’m stuck in a rather simple task: to get the category title for the current post, within the loop, to be used in the function (not to be automatically printed). Any ideas?

Using a portfolio_category slug in wordpress URL

I won’t lie – I don’t know php but I enjoy digging around trying to find ways to customize themes so that they behave how I want them to. Any help would be very much appreciated. What I am trying to do: There is a section in a wordpress theme I am using which allows […]

How to limit displayed posts on wordpress

How would I edit the following code, so that only 2 of the posts are echoed instead of 3 <?php global $more; $more = false; # some wordpress wtf logic $num_of_posts = $wp_query->post_count; $current = -1; $cat_id = get_cat_ID(single_cat_title(”, false)); if(!empty($cat_id)) { $query_string.= ‘&cat=’.$cat_id; } query_posts($query_string); if (have_posts()) : while (have_posts()) : the_post(); $current++ ?> […]

Get categories for a specific post – Custom post type

I’m trying to retrieve all the categories which are related to a specific post, using the wp_get_post_categories() function. The problem is that it is a custom post type, so I tried sending it in the $args array : wp_get_post_categories($id,array(‘post_type’=>’product’)); but that returned an empty array as well. What is the correct way of doing it?