Offset WP_Query by negative 1

I couldn’t understand your question. exactly Do you want next, prev post pagination? or You want to see next and prev posts titles or other content? Actually you placed an incorrect value to offset. You have to do something like this. // Initialize where to start the post from, 0 is most recent post $init_count … Read more

Multiple Query_Posts

Your problem, first, is query_posts. Please don’t use query_posts. Just don’t. Create a new query just like you did when you created $loop. Second, your inner loop alters the global variable $post. You need to reset that with wp_reset_postdata() after that inner loop runs. I believe that will take care of it.

Query to get last posts from authors of blog

get author ids instead of author nicename to get posts for muliiple authors using WP_Query(); $author_list = array(); foreach((array)$authors_list as $author) $author_list[] = $author->ID; // make comma separated string from author ids array $author_list = implode(‘,’, $author_list) and change wp query args $author_posts_args = array( ‘author’ => $author_list, ‘post_type’ => ‘post’, ‘cat’ => $colecti_id, ‘posts_per_page’ … Read more

How to filter multiple queries with search?

When I do a search on my theme, it only filters the main query… It’s exactly how it should do. The url change only the main query (or better, the main query in the one fired by args in the url). If you have secondary query on same page, they continue to work using the … Read more

Using rewind_posts for displaying multiple categories

Your main problem is that the cat param accept an integer (a term_id) as value, not a string of comma separed ids… You have to use category__in argument in your case. Read here for more info. Another problem is the use of showposts argument: setting it to 2 you’ll get 2 posts in total, not … Read more

How to create single page site in WordPress

Create a child theme for your current theme. Read how to here. After that create a file in your child theme named front-page.php. This is the first file WordPress will look for when you visit the home page of your site. To understand why, read here. In that file use: <?php get_header(); $all_pages = get_pages(); … Read more