The pagination doesn’t work

If this is a new WordPress install, it is likely that you don’t actually have enough posts to require pagination, and thus the pagination links aren’t appearing. Quick test: ensure you have at least two posts, then go to Dashboard -> Settings -> Reading, and change the “Posts Per Page” setting to 1. Do you … Read more

query_posts and sub pages?

I’m pretty sure you can use get_pages (http://codex.wordpress.org/Function_Reference/get_pages) function to solve this. It has child_of parameter which does exactly what you wanted. The only problem is that it returns posts and not set $wp_query, so you can’t use it as loop, but you can always call setup_postdata and then use template tags as in normal … Read more

Retrieve IDs from custom field, count and display results differently according to count

I answer to myself, since this code is working better (previous had an issue) and also I removed a useless “for”: echo ‘<ul class=”related-content”>’; $count = 0; foreach(get_field(‘related_content’) as $post_object) : $count++; if ($count > 0 && $count < 4 ) { printf(‘<li class=”large”><a target=”_blank” title=”‘.get_the_title($post_object->ID).'” href=”‘.get_permalink($post_object->ID).'”><span style=”display: block” title=”‘.get_the_title($post_object->ID).'”>’.get_the_post_thumbnail($post_object->ID, ‘small’).'</span><span class=”thumb-title”>’.get_the_title($post_object->ID).'</span></a></li>’); } elseif ($count … Read more

Please help me to win the battle with 2 column loop by category

You should not use query_posts more than one time. It will create errors. You have to use wp_query. Here is what it says in wordpress codex: query_posts( is meant for altering the main loop. Once you use query_posts(), your post-related global variables and template tags will be altered. Conditional tags that are called after you … Read more

Loop doesn’t work in single-product.php page but works at normal page

A part of the problem was that “caller_get_posts” is deprecated, it is now “ignore_sticky_posts”. The main problem was this line “$post_type = $wp->query_vars[“product”];”, i removed this one and replaced the $post_type with ‘product’. This code works! <?php $tax = ‘product_category’; $tax_terms = get_terms($tax,’hide_empty=0′); if (is_array($tax_terms)) { foreach ($tax_terms as $tax_term) { $args=array( ‘post_type’ => ‘product’, … Read more