0
votes
2answers
24 views

Query: offset post list, unless it's a specific category

Here's my code: <?php query_posts(array ('showposts' => '1', 'cat' => '-11')); if (have_posts()) : while (have_posts()) : the_post(); get_template_part( 'content', 'archives' ); ...
0
votes
1answer
48 views

Querying Multiple Categories With Different Offsets

On my website I have a "Breaking News" section which shows the most recent 4 stories in the "Breaking News" Category. Under this I have a featured news section which displays 5 more stories from the ...
0
votes
2answers
48 views

Creating two loops based on different logic

I'm trying to figure out the best way to go about this and I have part of my solution, but I can't figure out all of it. My ultimate goal is within a certain page template, to show the newest post ...
1
vote
2answers
54 views

Exclude the first 'n' number of posts of a tag from home page?

Use case (example): Using a separate, custom query my website's home page shows 5 featured posts, tagged 'Highlights (highlights)', followed by the latest posts, from the main query. I don't want the ...
4
votes
1answer
520 views

Different 'posts_per_page' setting for first, and rest of the paginated pages?

How do you set the posts_per_page query setting so that a different number of posts are displayed on the first of the paginated pages (of home, archive, search, etc.) and the rest of them? For ...
0
votes
1answer
322 views

offset WP_Query by negative 1

I have an event loop and I was wondering if it's possible to somehow offset the loop by -1 so the prev and next posts of the current post are shown. --edit-- Okay thanks for your comments, my ...
0
votes
2answers
663 views

How to adjust found_posts so that it accounts for offset and pagination

So far this is the code I have in my index.php file: <?php // Custom code to offset posts and setup pagination $page = get_query_var( 'paged' ) ? get_query_var( 'paged' ) : 1; ...
0
votes
1answer
227 views

How do I rewrite this loop as a new WP_Query style-loop?

How do I rewrite the if (have_posts()) : ... while (have_posts()) : the_post(); style Wordpress loop below as a new_query style-loop using <?php $the_query = new WP_Query();? ( As shown in ...
0
votes
1answer
993 views

Custom query, works, but I get a “Notice: Undefined offset: 0…”

My custom query works, but in debugging mode I get this error: Notice: Undefined offset: 0 in /storage/content/24/150624/mydomain.com/public_html/wp/mysite/wp-includes/query.php on line 2232 This ...
1
vote
1answer
1k views

WP_Query: offset ignored when posts_per_page is -1?

Is it only me or this is what's happening? I just want to get all posts starting from a certain offset, like 10. Instead I get all posts starting from the 0.
0
votes
1answer
569 views

WP_Query - Adding “offset” posts to the end of the loop

I'm trying to create two queries. In the first query, I will, for example, display 6 posts, in a given order. In the second query, I want to display the same 6 posts, but "offset" the first 3 and ...
0
votes
1answer
902 views

Stomping WP_Query in author archive to facilitate pagination with custom queries

I am using get_posts and get_comments to build several loops on the page, at which I am having some issues in pagination. I have the global posts per page option (Settings > Reading) set to 10, and ...