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
vote
3answers
2k 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. ...
2
votes
2answers
2k 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 ...
2
votes
2answers
1k 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
191 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
22 views

How to exclude post from being queried based on custom meta value

I am building a reviewing system for user-submitted posts on my website. I have a page called page-review.php which displays the oldest post of the "pending review" category. This is to ensure that ...
0
votes
2answers
17 views

Display an author's posts on his own author page

I have a blog that publish articles of any philosophers.Each philosopher has a special page that includes information about him. I've created a post type called philosopher. I want to display the ...
0
votes
2answers
40 views

Easy way to write complex queries in wordpress

I want to run one sql query like this in wordpress. Just wanted to know if there is an easy way to do this in wp. Thanks. Is this query possible with the use of query_posts anyhow? select ...
0
votes
2answers
106 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
67 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
140 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
149 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
422 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'); ...
-1
votes
2answers
1k 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
1answer
218 views

Getting images from media library and get_the_date() not working

I've got a function to display all images in the media library on a page. I would like to display the date of each image, but using get_the_date() only returns today's date. Here is the code I'm ...
0
votes
1answer
125 views

Advanced WP Query and/or

I'm trying to create an advanced, reusable query function. I need to query by category OR a category + a tag. I know how to do this with custom fields (meta queries) but how do I do it with simple ...
0
votes
1answer
269 views

get_next_posts_link() stops displaying at page 4

Please start by taking a look at this quick video: http://www.screenr.com/8vSH The problem: get_next_posts_link() disappears on page 4. That is, the "go to older posts" link disappears once I am in ...
0
votes
1answer
148 views

How to get all post titles starting with numbers and symbols?

I want to get all posts which are starting with a number (0-9) or symbols, in a list. I managed to get it work for letters, but this one is harder for me. Can someone help me out please? I tried ...
0
votes
1answer
59 views

How to inject a post within a loop

I'm trying to inject a post while the loop is running. This post will be injected on a condition, so if(x == j){ //inject post here } I see this would seem easy to do, but i have a posts_per_page ...
0
votes
1answer
182 views

How can I change the publish date based on a custom field?

How can I change the publish date based on a custom field? Author uses a date picker to choose the date for journal entry. The date is used to make a list of all the users journal entries. I can ...
0
votes
1answer
190 views

How to get alphabetic listing x other posts, based on first letter post?

Let's say I have a post called "Hello World" and I am on that page... Let's say I have different posts like "Haaaa" and "Hoooo".... What I want to do is showing Haaa and Hooo in a different place (let ...
0
votes
1answer
320 views

Transfer taxonomy to custom field

I have a blog with movie critics and I'm using many taxonomies to add some informations about the movies, like director, actors or it's year. Using taxonomies is really useful to display all movies ...
0
votes
1answer
53 views

PHP dynamical conditional post display

I'm trying to get the WordPress loop to display only the post has an ID that reflects whatever $category_name is equal to, as shown in the line of code below. It ends up showing everything and not the ...
0
votes
1answer
161 views

Query specific posts per user selections from dropdown menus

This may be a little different than most people do. I'm trying to show certain posts that are determined by 4 different "categories." I have a large database table full of "products" (I'm using the WP ...
0
votes
1answer
255 views

Search a title word through query_posts (not the exact match)

We're working on a database with personal data from different sportsmen such as name, height, weight, etc. We've managed to build a detailed filter through query_posts. Every filter field is working ...
0
votes
1answer
102 views

What's the best way to show custom post types? With page template it's not perfect!

I created a custom post type with name career. I would like to know what's the best way to list the posts. I created a page template with a query inside, but the pager is invisible. I don't know ...
0
votes
1answer
58 views

Creating pages and getting their values from the database table

I need to make inquries from my new website. I want to know whether Wordpress is capable of this: Say it I have such a table: CREATE TABLE IF NOT EXISTS `mytable` ( `id` int(11) NOT NULL ...
0
votes
1answer
53 views

Adding Category Argument into an Array for WordPress Query

I'm new to customizing WordPress and am looking to query an array of posts within a certain category. I have a display that's showing an array of all posts from the site: $arguments = array( ...
0
votes
1answer
99 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
65 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
222 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
160 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
317 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
33 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
66 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
50 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
96 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
515 views

How to Display Post View Count

I am trying to display post view counts. I've tried below function to display the post view count, but I'm getting same post view for all the post in loop. Not getting correct post view count. ...
-1
votes
1answer
36 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
337 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> ...