query in category.php repeats itself

You should take the condition outide the loop meaning above <?php if (have_posts()) : while (have_posts()) : the_post(); ?> Therewise every time the loop begins it start the check instead of doing the check then starting the loop if the condition exist. Its hard for to understand because i dont understand div names but i … Read more

Query posts from category based on a filter most favorited

query_posts accepts custom query variable as arguments. So assuming that adding ?sort_by=most_favourites to an url alters the sort order to sort by the most favourites (i.e. you’ve set sort_by as a recognised WordPress query variable, and setting it sorts the returned posts accordingly) then, try: $args = array( ‘cat’ => $cat_lists[$i], ‘showposts’ => intval(get_theme_option_by(‘bn_list_per_item’, 6 … Read more

Rewrite a category

You cannot use the same term for a category, page, tag as they need to be unique. When you do, you’ll get a number next to the slug To fix them you’ll need to fix the tag or page slug otherwise edit the category slug last http://wordpresssites.net/links/how-to-edit-change-fix-duplicate-category-slugs-in-wordpress/

Hiding a Categories content on just the Homepage ‘Posts’?

Okay, it sounds like you’ll want to modify the primary Loop using query_posts(), but only on the Site Front Page. I don’t think TwentyTen includes a front-page.php template file, so we’ll modify index.php directly. Add the following code to index.php, anywhere before the Loop output: <?php // Determine if we’re on the site Front Page … Read more

How to Exclude post from a category

To exclude a category you’ll need to modify the query that’s running. Do this using the query_posts() function: http://codex.wordpress.org/Function_Reference/query_posts First, you’ll need to get the ID of the category you want to exclude: $exclude_category = get_term_by(‘name’, ‘collage’, ‘category’); Then you’ll need add the category exclusion to the query, and pass the new query to query_posts: … Read more

If statement for catergories

<?php $current_user = wp_get_current_user(); if ( is_category( ‘Cars’ ) && 0 == $current_user->ID ) { ?> <!– HTML markup here –> <?php } else { ?> <!– other HTML markup here –> <?php } ?> ID will be 0 in the $current_user object, if the user isn’t logged in. Related reading: is_category wp_get_current_user EDIT Try … Read more

add text to the top of category page

May I suggest using one plugin that I use for my sites ( I am a web-developer)? I Use Extra category content plugin (http://www.greatwpplugins.com/extra-category-content/) if I want to put any kind of content (text, image, link, etc) before the post listing in a category. Just install the plugin, edit a category to add some extra … Read more