Problem with different query loops (and “main loop”) on category template page!

In order to provide more-specific help, we’ll need to know greater detail regarding exactly what’s happening that you don’t expect, or what’s not happening that you expect to happen, or what is happening differently from what you expect. That said, there are at least two things that will likely help you: Use descriptive and unique … Read more

Trying to get variables in hacked category dropdown

The dot . in your code is evaluated as string litral, and not concatenation. Meaning if $inpCnt was equal to 5 for example, php will search for name=”scrape[“.5.’][sponsors]’ id= and will fail to find it. You can either remove the dots while still using the double quotes: $sponsors = str_replace( “name=”scrape[“$inpCnt’][sponsors]’ id=”, “name=”scrape[“$inpCnt’][sponsors][]’ multiple=”multiple” size=”19″ … Read more

Pagination on category.php and tag.php not working

If you merely want to modify posts_per_page for tag and category archive index pages, don’t use query_posts(); instead, filter the $query via pre_get_posts: function wpse87489_filter_pre_get_posts( $query ) { if ( ( is_category() || is_tag() ) && $query->is_main_query ) { $query->set( ‘posts_per_page’, ‘2’ ); } } add_action( ‘pre_get_posts’, ‘wpse87489_filter_pre_get_posts’ );

How can I tell what category I’m in– in the header?

The in_category( $category ) conditional only returns true when the current post has the specified category assigned. If you want to determine when you are on a category archive index page, you should instead use is_category( $category ): if ( is_category( ‘Restaurant Reviews’ ) ) { // The current page is the Restaurant Reviews // … Read more

Get URL Category Name By ID

You are already using the get_term_by() method in your code. That’s the way to get information about your category, i.e.: $myterm = get_term_by(‘id’, $cat_id, ‘category’); if ( $myterm ) { echo $myterm->name; } PS. I used ‘category’ as taxonomy, you might have a different term (i.e. ad_cat).

Show the latest post from child category?

Just change your query to search for the category you want. $qry = new WP_Query(‘category_name=paparazzi&showposts=1′); while($qry->have_posts()) : $qry->the_post(); That should most likely be all you need to do. And please don’t use query_posts. It alters the main query and can break things.