The tag has no wiki summary.

learn more… | top users | synonyms

0
votes
1answer
14 views

Offset loop not showing the last post

I can get all my posts in the following loop to show except the last? There should be ten posts but it's only showing nine? <div class="row staff-board"> <?php ...
-1
votes
2answers
72 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
64 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
53 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 ...
0
votes
3answers
172 views

Get post offset/posts page offset in single post page (outside the loop)

I would like to know how I could get the offset of a custom post or its page, outside the get_posts loop. I developed an external web application which connects to the wordpress blog with JSON API ...
1
vote
2answers
71 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
811 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
2answers
162 views

Get the index of post outside the loop

I'm trying to find out the index of the post which is currently viewed (single post page). I have an overview of the articles in the same category in a sidebar. But when a user navigates to a post ...
0
votes
1answer
427 views

Offset WP_Query by negative 1

I have an event loop and I'm wondering if it's possible to offset the loop by -1, so the prev and next posts of the current post are shown. EDIT - Thanks for your comments, I think I can clarify. ...
0
votes
2answers
912 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; ...
1
vote
2answers
1k views

Specific Loop For 2 <div> Within Each <li>

I need to create a loop that can logically be described as the following for a carousel: Requirements: 3 Loops 2 Posts Per Loop No Duplicates Order by Post Date Visual: < Start Loop #1 > ...
0
votes
1answer
122 views

Offset posts with random order

I'm trying to have five advertisement locations, each pulling posts from the same custom post type, but also loading randomly. The only problem I have with my code below is that it will sometimes ...
0
votes
1answer
369 views

wordpress category.php query for featured news item, broken pagination and repeating posts

I am having a few issues with a site I am building, on the news page It has 1 featured post from the news category and then under that more news category posts, but missing out the featured news item ...
0
votes
1answer
106 views

Calling two images at a time? A better way?

I'm having trouble wrapping my head around the best way to achieve this. I'm trying to load two photos at a time into a which serves as a slideshow wrapper. Currently i'm repeating a lot of code and ...
3
votes
2answers
544 views

Using Offset in Custom Post Type Query

I'm using the following query for a custom post type: <?php $posts = get_posts(array( 'numberposts' => -1, 'offset' => 20, ...
0
votes
1answer
394 views

Offset Loop by 1 , Limit next loop to 1 (Most Recent) Post

I have a loop that I would like to Offset by 1 so the most recent post is not displayed, and another loop where I only want 1 item which would be the most recent post. These are the loops I tried: ...
0
votes
1answer
245 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 ...
2
votes
2answers
375 views

Most commented / popular posts and offset

I am using this code to show 3 most popular posts based on number of comments : <?php $pop_posts = 3; $popularposts = "SELECT $wpdb->posts.ID, ...
1
vote
1answer
1k 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 ...
0
votes
2answers
197 views

Keeping get_posts' offset and is_paged() synchronized

I am developing the blog-template of my theme, which works as following: The user can input the total post-count to display on each blog-page ($blogpost_count). The blog itself lists post-entries in ...
0
votes
2answers
543 views

Related Posts loop - offset

I've been working on this for many, many, many weeks already. I've already asked similar questions here and elsewhere, but nobody seems to be able to sovle this problem. Maybe it's not possible ...
0
votes
1answer
369 views

Offset for Loop

I want to have an offset of 4 posts for my related posts. I'm using Flowplayer's jQuery Tools Scrollable, so I want people to be able to scroll through the 4 latest posts, then the next 4 posts etc. ...
0
votes
1answer
359 views

Offset a post in the loop, with using PageNavi Plug-in

I am trying to offset 1 post in my main loop, I have tried a few things Like query_posts() etc etc, and i can get the offset to work but my pagination ends up not working , I am using the PagNavi ...
0
votes
1answer
183 views

Loop Offset for tag based “Related Posts”

As I'm using the jQuery Tool "Scrollable" for my Related Posts section (see example here), I was wondering how I can implement an offset so that in the first loop it'll show the first 4 posts, then ...
0
votes
1answer
226 views

How do I add a timezone offset to this query?

Problem is that $today is pulling GMT from the database; I need to offset GMT by -6 hours; Have been unable to find a query with an offset like that. <?php $paged = ( get_query_var('paged') ) ? ...
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.
1
vote
1answer
243 views

Comments offset

I need to display comments starting from the second, omitting the first. With posts I did it using "offset" but I can't find anything similar for comments. Since I'm using threaded comments, must ...
0
votes
1answer
596 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
918 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 ...