Set up The Loop with query parameters. This will override the current WordPress Loop and shouldn’t be used more than once. This must not be used within the WordPress Loop.

learn more… | top users | synonyms

-1
votes
1answer
33 views

Limitless amount of posts in custom archive page

I want to get rid of pagination completely on my custom archive, I want everything on 1 page. How can I do this? Currently I'm getting my posts with: <?php query_posts($query_string . ...
0
votes
0answers
167 views

Query Posts From Multiple Post Types

Is there an easier or more efficient way of querying posts from multiple post types by the date of which they were published? I read this question here: Using Query Posts With Multiple Post Types And ...
0
votes
1answer
68 views

Co-authors plus problems with query_post

I had a query_post that worked, aimed lists only posts by author own, but now that I updated wordpress stopped working. The query_post only works when you have only one author. I updated WordPress ...
0
votes
0answers
19 views

Styling every second Post differently? [duplicate]

I wanted to style every second post inside of a query post and I found a solution which nearly works. the thing is: it outputs just two posts (older ones will be igrnored) but i want to output ALL ...
0
votes
1answer
192 views

orderby:date not working

I have been searching for an answer and it seems like there are a lot of answers for the opposite issue. I am trying to sort by publish date, not by date modified, using this code: ...
0
votes
2answers
60 views

Only display posts with comments

I would like to query out only posts that have comments. So posts with comment_count = 0 won't show but anything above that will. This is what i query but it still picks out posts that doesen't have ...
0
votes
1answer
77 views

wp_query by last month + sort posts

I'm using the WordPress plugin 'I recommend this', it allows people to 'like' posts. The value is stored as a meta key, which we can query to generate a 'most recommended' page. Plugin -> ...
0
votes
1answer
62 views

get_posts and wp_autop (remove filter)

I just transformed my query_posts function in a get_posts function. Here is my old function: <?php // The Query query_posts( 'cat=170&showposts=4' ); remove_filter('the_excerpt', 'wpautop'); ...
0
votes
1answer
51 views

get_posts output always same post

I'm trying to output the last (chronologically) 4 posts having the tag (slug) "pp". <ul> <?php $args = array( 'posts_per_page' => 4, 'taxonomy' => 'tag', 'field' => 'slug', 'terms' ...
0
votes
2answers
165 views

How to limit the number of results for all query_posts on mysite

I have a huge number of posts and the pagination with no limits eats my server CPU and ram so I need a function to limit the number of posts for all query_posts on my site and I need this function to ...
0
votes
2answers
58 views

query_posts result differs from wp_query request result

I have a multisite Wordpress setup (3.5.1, I cannot risk updating) on which I am querying some posts after having switched to the correct blog. I have a query_posts function with the following ...
0
votes
2answers
182 views

Wordpress query_posts by tag doesn't work anymore(?)

I had this code running fine forever. Some days ago it just started outputting nothing (just the <ul></ul>). No errors in logs: <ul style="margin-left:0"> <?php ...
0
votes
0answers
12 views

how can I display all post using query_posts? [duplicate]

I created a template page to display my posts. My problem is I get 10 post on my page and after those 10 post i have option to click old entries and when I click it, I get the same post again instead ...
0
votes
1answer
69 views

How to show only the most recent post on my custom post type archive?

I have registered a custom post type and inside my archive-myCPT.php I want to retrieve just the current published post. Here is a relevant snippet from my archive-myCPT.php: <?php if( ...
0
votes
1answer
1k views

How to get current post id of a custom post type in a loop using template singel-{custom type}.php?

I have a custom post type template where am looping through all post. what i am trying is when i go to my custom post page i want to get the current post id in the loop. So i tried to check if the ...
0
votes
1answer
57 views

How to query post ids liked by the Author

I'm using wti_like plugin and this is how i get the number(count) of post liked by the author // Get the author object $author = get_user_by( 'slug', get_query_var( 'author_name' ) ); // Get the ...
0
votes
2answers
76 views

Set colors depending on category

I have this function which outputs the last 6 posts of categories 1 and 2. <ul> <?php query_posts('cat=1,2&showposts=6'); ?> <?php if ( have_posts() ) while ( have_posts() ) : ...
0
votes
1answer
183 views

post_name empty after wp_insert_post

I'm writing an external tool that inserts post in wordpress (I'm using the wordpress functions). I read also this discussion: wp_insert_post does not write my post_name But my problem is a little ...
0
votes
1answer
185 views

3 random images from custom post type, each in a div with a diffrent class

I'm trying to build a loop using query posts to display 3 featured images from the custom post type 'portfolio'. My problem is that each picture has to be in a div with a diffrent class, so i was ...
0
votes
1answer
113 views

How do I query_posts in cat=1 AND not in cat=2

Let's say I have 3 categories, College (cat=1), Corporate (cat=2), and Idea of the Week (cat=3) There is a home page for College and a home page for Corporate. On the College home page, in one ...
0
votes
0answers
29 views

Array in POST request -> is 404

I send array in post request <form action='<?php echo get_permalink(); ?>' method='POST'> <input type="hidden" name="question[]" value="<?php echo $question->ID ?>"> ...
0
votes
1answer
133 views

query_posts not working after wordpress 3.7 update

I recently updated to wordpress 3.7 and all of a sudden my posts page stopped working . it shows nothing and opens up a blank page . there is small code on that page and it stopped working . It was ...
0
votes
0answers
69 views

Join two wp_query

So, i have custom posts with this settings: Example 1: have meta_key "price" Example 2: have meta_key "no_price" So, i want to list this posts ordered by "price". I just want to join these two wp ...
0
votes
1answer
28 views

Return only custom post types for the page, not all

I'm currently working my way through some custom posts (for the first time). I'm managing to return the bits I need using this <div class="pagered"> <h1 ...
0
votes
0answers
38 views

Joining column from table to query_posts

This is more of a question to be sure that I am on the right track with how I want to do this. I am using a custom template that uses elements of theme to display products based on filter results. I ...
0
votes
0answers
27 views

use more than one meta key in query using posts_where

Here I want to add query for more then one meta key as here: $where .= " AND meta_key='order_assign_delivery_date' AND meta_value LIKE '0000%' And meta_key='order_assign_data' AND meta_value=0"; so ...
0
votes
0answers
10 views

Pagination on custom template doesn't work [duplicate]

I have a custom template for my blog homepage and for some reason the pagination isn't working. I am using next_posts_link and previous_posts_link for the pagination. The main blog page is located at ...
0
votes
1answer
41 views

query_posts ignores the argument

The query_posts totally ignores the day argument. I'm trying this: $day = date('j'); query_posts('day='.$day); if (have_posts()): while (have_posts()): the_post(); //show posts endwhile; ...
0
votes
1answer
192 views

If meta_key has value = 6 | Change the wp_posts.post_date to current date

I have three sections: 1-New posts 2-Trending posts 3-Hot Posts I'm using a Vote plugin and i sort every section like this: New Posts: $args = array( 'meta_query'=> array( array( ...
0
votes
0answers
167 views

Add a DropDown Taxonomy Filter on Archive Page

I need to add a taxonomy dropdwon filter in archive page so that I can display the posts assigned to selected taxonomy. Here is the HTML Output for taxonomies: <form method="post" ...
0
votes
0answers
11 views

How to show specific tagged posts and ordered by future date on the homepage

I'm creating a site that has upcoming shows on the homepage. I would like the future shows that are up next to show on the home page. I have created a custom field on the posts called "show_date" with ...
0
votes
0answers
182 views

Converting an existing query_posts to WP_Query

I am having trouble trying to convert my query_posts loop that is bugging out to a WP_Query, was hoping someone may have some luck looking at it: This is my old loop: <article ...
0
votes
1answer
30 views

Why are some of my custom posts not showing up on my page?

I have 6 posts with a custom post type in my Wordpress theme. I want to show them all on a page but I can only get a maximum of 3 to show up, regardless of how many there are. I have this code in the ...
1
vote
1answer
266 views

How do I create my own nested meta_query using posts_where / posts_join?

Some of my posts (not all) have a price as a meta key/value. Today I use the pre_get_posts action so that my users can search for prices that are between a certain value. This is the code that I'm ...
0
votes
2answers
89 views

HM CMB: Post Select Field for CPT ID

'm using human made's custom meta boxes framework (https://github.com/humanmade/Custom-Meta-Boxes). Using the post select: array( 'id' => 'example-field-post-select', 'name' ...
0
votes
0answers
48 views

Show post when both categories are present but not one of them

I'm having issue filtering posts by category. There is the A category for posts (which is the default and also applies when no category has been set explicitly) and B category with subcategories for ...
0
votes
1answer
52 views

Wordpress Query showing multiple titles

I have written a query to display in a jquery slider (nivo) however it appears that it is showing all the posts and not just one at a time This is my code: <div class="slider-wrapper ...
0
votes
4answers
198 views

Query Posts by date range with fixed beginning and end

I need to get posts from a certain timeframe. I am using the posts_where filter. I want to specify a beginning date and an end date. This is the function I use: function filter_where( $where = '' ) ...
1
vote
0answers
61 views

BBPress Search results in Wordpress search

I want to display in Wordpress search results page - 10 or less found results from BBPress (plugin) forums. I know that BBPress use custom post types (forum, topic, reply) but I don't know how to do ...
0
votes
1answer
86 views

Query_posts works when appending via AJAX call wp_query doesn't?

I'm appending some posts on a click event to a twentyeleven child theme. For some reason though it only works when I use the query_posts loop and not a wp_query loop. For instance here's my wp_query ...
0
votes
2answers
117 views

Insert custom div between posts

I'm using twenty twelve and I need to insert a div between the posts. I'm not sure how to stop the loop, insert the div, and then restart the loop. Can anyone shed some light on this? Thanks.
0
votes
0answers
31 views

Limit posts displayed to 2 specific posts

I'm using the Twenty Twelve theme. I have created a basic page. What I want to do is keep 2 only posts (that I select) on the page at all times. In looking at the code I think this is the section that ...
0
votes
1answer
343 views

WordPress displays post on subcategory only

I'm using WordPress on developing a site and a self-made template. I got 1 page to display all categories with its post. This is what I want to do: Main Category subcategory1 post 1 subcategory1.2 ...
0
votes
0answers
36 views

Posts from current category on custom page

I have a problem - I want display posts from current category on page with custom template. I write something like this: <?php include 'header.php' ?> <div class='content'> ...
0
votes
1answer
89 views

custom query to get posts

I want to create custom links like mydomain.com/custom_page/cat=ABC&tag=XYZ So that when a user clicks on the link s/he can see all posts in the category 'ABC' having tag 'XYZ' For this I've ...
0
votes
1answer
223 views

Why doesn't my WP Meta Query return any results?

Is it not OK to accept a value from $_GET as the key in a WP Meta Query? I'm not sure why this code doesn't return any results... BOTH the queries for Price as well as bedrooms do not return any ...
0
votes
1answer
259 views

Filter archive.php by custom meta

I"m trying to filter an archive page by custom meta query. I've tried using query_posts($args) prior to the loop, but it returns nothing. Any ideas? Here's what I have so far: <?php ...
0
votes
1answer
143 views

Can I use WP_Query one time and then filter the results multiple times

I am using the following code 20 times in one page template to query specific data for each section. All of the pages data comes from the same post type, just I need it divided up by a specific custom ...
0
votes
1answer
76 views

Read more doesnt work with query posts

The tite says it all. If I comment out the query_posts it works, if I don't it doesn't. <?php // retrieve one post with an ID of 1 query_posts('p=27'); global $more; $more = 1; ?> <?php ...
0
votes
2answers
259 views

Two posts in same div - WP loop

I would need the following in Wordpress: <div class="posts-wrapped"> <div id="post-1" class="post"> <h1>Title 1</h1> </div> <div id="post-2" ...