Linked Questions

1
vote
0answers
13 views

Conflict with get_posts and the_content

I have this snippet in my header.php to display a slider: <?php $args = array( 'post_type' => 'post', 'posts_per_page' => 6, 'meta_query' ...
-1
votes
2answers
43 views

Limit the number of posts via wpquery

We suppose that a category has 1000 posts, we can use the following code to show 10 posts per page and the wp pagenavi would present 100 pages with links of above 1000 posts. <?php ...
1
vote
2answers
9k views

How to get posts published between a date and today?

Is it a way to get posts published between a date and today with query_posts() ? Example : All posts published since 2012-04-01 Thanks EDIT : How to add the filter date on this Query Posts ? ...
0
votes
1answer
22 views

Wrong post title displayed from loop

I'm building my own theme. I have a page set for my blog (with a template that I made) which I'd like to just display a few of my posts. It uses the following loop: <?php ...
0
votes
0answers
21 views

WP_Query is being reset after <header> tag (using chaining method)

I'm creating a page template. In this page template I create a custom query. - page-recipes.php: <?php /** * Template Name: Recepten - archief * chained with /archive-recipes.php * */ ...
0
votes
2answers
333 views

wp_query within function within wp_query

I have a query which looks like this: $args = arguments for the query $query = new WP_Query($args); while ($query->have_posts()): $query->the_post(); $post_id = get_the_ID(); echo ...
0
votes
1answer
20 views

2 queries with counters

I have 2 loops on a page both containing a counter to implement slightly different code every 6 posts. For some reason though the second loop is implementing the different code sometimes after 4 items ...
21
votes
1answer
14k views

How to fix pagination for custom loops?

I have added a custom/secondary query to a template file/custom page template; how can I make WordPress use my custom query for pagination, instead of using the main query loop's pagination? Addendum ...
0
votes
1answer
286 views

Order by ASC, DESC, Title, Date from URL on custom page template post

I have a Page with Custom template. In this template I have index all posts of a category with many more modification. I know i can do this by creating Category specific template but this is different ...
0
votes
1answer
37 views

How to do a loop inside a loop?

I'm trying to get posts from a custom posts using WP_Query. <ul> <?php $query1 = query_posts( array( 'posts_per_page' => -1, 'post_type' => array('specialties') )); ...
6
votes
2answers
7k views

Get all image from single page using this query

I'm having some trouble with this sample widget code. I want to get all images (Minus the post thumbnail) from a page called "Gallery" but for some reason this is pulling all uploaded images from the ...
0
votes
1answer
118 views

Custom meta box with jQuery.sortable custom post type list

What I'm trying to do is have a custom post type ordered differently on different pages. I've searched around for quite a while and can't seem to find anything to help. I have a post type named staff ...
0
votes
0answers
20 views

posts_per_page not returning correct number of posts

$queryArgs = array( 'post_type' => 'recipe', //'orderby' => 'menu_order', 'orderby' => 'date', 'order' => 'DESC', 'posts_per_page' => 10, // 'posts_per_page' => -1 ); ...
4
votes
1answer
644 views

WP_Query ignores post_type in category view

I have following query to select posts by my custom post-type. This works fine while being on the frontpage (the snippet is included in the sidebar). As soon it gets executed on a category page the ...
1
vote
2answers
21 views

Posts not showing on page

Can anyone spot anything wrong with this code(see below). No content is showing up on my page. Many thanks in advance. <?php $args = array( ...

15 30 50 per page