Linked Questions

0
votes
1answer
5k 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 ? ...
68
votes
3answers
33k views

When to use WP_query(), query_posts() and pre_get_posts

I read @nacin's You don't know Query yesterday and was sent down a bit of a querying rabbit hole. Before yesterday, I was (wrongly) using query_posts() for all my querying needs. Now I'm a little bit ...
5
votes
1answer
429 views

WordPress Posts By Date/Day?

I want to output on the homepage the posts from the lastest 3 days. Like this: 30/03/12 post 1 post 2 post 3 29/03/12 post 1 post 2 post 3 28/03/12 ...
0
votes
2answers
2k views

How to order posts by modified date without using 'query_posts'?

I have an example basic wordpress theme template here for you. First, please take a quick look at it to get an idea. <?php get_header(); ?> <div id="primary"> <div ...
1
vote
1answer
392 views

Possible to display posts containing a short code ?

i have some posts with a certain shortcode in them. unfortunately these posts are in different categories and contain different tags so i am not able to query them. is it possible that i run a query ...
0
votes
2answers
252 views

Modify loop but keep the original query, what am I doing wrong?

I have a custom post type where I have a taxonomy cities and a term berlin. Archive can be seen at example.com/cities/berlin and it's rendered normally from the archive.php template. Now, I want to ...
0
votes
2answers
119 views

How to Loop with the final result formatted differently?

I need to list post_title's in this specific format (note the last title in the list must not have a comma) "post_title","post_title","post_title" I thought a mini-loop might work. Here's what ...
3
votes
1answer
168 views

Add 20yrs to post date, and then query

I would like to know if anyone knows a way of adding a timeframe (say 20 years) to the datestamp on a set of posts, and then running a query on the loop which uses the new date? Basically what I want ...
3
votes
2answers
1k views

Archive by Year

After some searching I haven't been able to find a answer to what I'm trying to archive. I'm trying to set up an archive page with accordion panels that hide/show posts from a given year with links. ...
1
vote
1answer
385 views

how do i remove posts from a WP_Query so the pagination is right?

I'm using a custom post type and showing 20 of them per page on the homepage. I'm using QP_Query. One custom field for the custom post type (called mixtapes) is a checkbox called "unreleased" (set ...
2
votes
1answer
119 views

Can ordering post list by meta_value cause performance issue?

For some code refinement and to add new features to my plugin, I want to display posts ordered by specific meta column value like this; query_posts($query_string . ...
1
vote
1answer
745 views

Query get post,how to add comment box

Hello I have a query that gets a post with id=x and it works but it leaves out the comment box. Is there a way to add "get comment box" to the query? <?php $post_id = 104; $queried_post = ...
0
votes
2answers
2k views

Displaying related posts in a custom post type by a custom taxonomy

I'm trying to display related posts by a custom taxonomy (product_tags) in a custom post type (products). The following code works, but it ignores posts_per_page. Any ideas? global ...
0
votes
3answers
484 views

Using next/previous_posts_link with customised search

I have a few different searches on my website: "Species profiles" (custom post type search) "Glossary" (custom post type search) Generic, site-wide search Currently I'm using search.php; ...
0
votes
2answers
165 views

why to use query_posts() in custom page?

Hi i am new in wordpress and want to know about query_posts() function. If there is index page or home page than there is no need this function to display post but if i made custom page than there ...

15 30 50 per page