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

2
votes
2answers
832 views

get_query_var('paged') always returns empty

Putting this up after having hit a brick wall for possible solutions. Have a site with quite a few custom post types and associated custom taxonomies. To help make things easy, I'm using a unified ...
1
vote
2answers
1k views

Sort Posts by Multiple Meta Values

1) Custom Post Type named "Buying_Locations" 2) Each Post has three meta values of: State, City, Store Name QUESTION: How can you show a list of these posts sorted alphabetically by State, then ...
1
vote
2answers
1k views

Loading post content in FancyBox

I got a tricky question. I have created a custom post type whose posts I would like to display in a scrolling carousel. The carousel will only display the title, the excerpt and a "read more" button. ...
1
vote
2answers
155 views

Query last updated posts (posts updated in the last 24 hours)

I'm having some difficulty to find an example of how to create a loop with posts that had been updated in the last 24 hours. My idea is to have a page of posts or perhaps on the index.php a lists of ...
0
votes
2answers
59 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
65 views

The Loop isn't working

I can't get the loop to work as it's supposed to, without using the not-so-recommended: <?php query_posts('post_type=post&post_status=publish&paged='. get_query_var('paged')); ?> I'm ...
0
votes
2answers
690 views

Achieving pagination with `query_posts`

I'm using query_posts to build a list of posts from a single category, and I'm trying to add pagination to this setup. Here's my code: <ul> <h1><?php the_title(); ?></h1> ...
0
votes
2answers
113 views

show posts from one category with comments only

Would anybody have a good idea for getting the WP to spit out all posts from a category with (approved) comments only? I have an ecommerce site set up, and treat comments on product posts as ...
0
votes
2answers
126 views

Custom MySQL query to list post

I have the following query: SELECT p.* FROM orders_items oi INNER JOIN products pr ON pr.`post_id` = oi.`product_id` INNER JOIN posts p ON p.`ID` = pr.`post_id` AND p.`post_type` ...
0
votes
2answers
370 views

Getting custom post type info using get_adjacent_post

This is an example of how I'm grabbing images from my custom post type now, using query_posts(); // query_posts stuff made up here. $my_array = get_custom_field('image:to_array', 'to_image_array'); ...
0
votes
1answer
94 views

Wordpress plugin not eching popular posts

I created a plugin in wordpress to show popular posts, but this is not returning the post and number of comments properly. Even I have comments in my post(approved as well, so this is not the case) ...
0
votes
1answer
61 views

How to apply order on custom taxonomy and custom meta key on custom post type

Here is the code in am using $arg= array( 'post_type' => 'vr_listing', 'tax_query' => array( array( 'taxonomy' => 'vr_listing_status', 'field' => ...
0
votes
1answer
189 views

Counter code for paginated category pages in wordpress

I am trying to customize the category template whereby I wish to show the ordered list of 10 posts on each page. I am using the following code in the loop: <?php $counter = 1; ...
0
votes
1answer
137 views

query posts returns 10 records

I am using the following code to fetch records from a custom taxonomy. if ($_GET['post_type'] == "developments"){ ?> <?php global $wp_query; ...
0
votes
1answer
235 views

Include a specific post to the query_posts and remove it if it is already in the returned list

Bare with me. Firstly, here is my whole script for my featured slider articles: <div id="featured" class="<?php if ( $responsive ) echo 'flexslider' . $featured_auto_class; else echo ...
0
votes
1answer
29 views

Assign a tag to custom post type using a query

I have a custom post type courses with a custom field level. I want to run a query (mysql or WP query) that runs through every course (post) and if the level is greater than 3, append a tag called ...
0
votes
1answer
63 views

How to can I search range of products using between

I want to show the range of my houses as per size. Ranges will be: 1-50 50-100 100-150 150-200 200-250 +250. HTML code <select name="size" id="search-type" class="text<?php echo $select_wide; ...
0
votes
1answer
45 views

Link to most recently created category of custom taxonomy in primary navigation menu

I have a custom taxonomy called Issues (like magazine issues) with categories named after the title of each issue. I created a page called "Current Issue" and added a link to it in the main ...
0
votes
1answer
95 views

Filtering posts by WORD in custom field

I need to filter my posts in categories pages, by showing only posts that have specific WORD in custom field value. I need php code that i should add in loop for this category. Details: I need loop ...
-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 . ...
-1
votes
1answer
220 views

How do I find the first item in the post array?

I left ????? where I need the answer. <?php global $post; $the_post_ID = $post->ID; $n = get_posts(); ?> <?php foreach ( $n as $post ) : ?> <nav id="postNav"> <ul> ...