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
1answer
2k views

how can i get posts from custom post type particular taxonomy category

I have registered custom post type Article in my template using register_post_type function. and i also having taxonomy category for this article posts. Here i want to filter the posts under ...
1
vote
1answer
612 views

Read More is not working in query posts

I have Query_posts in my page. the posts have tags to separate for read more, But while doing query posts it is pulling all content for <?php the_content('read more..');?>
1
vote
2answers
328 views

how can i use custom field in query post

I want to get all featured items using query post. featured is meta_key using custom field plugin. I tried bellow,but it failed $featured_item = new ...
1
vote
3answers
3k views

how to group custom post type posts by custom taxonomy terms

I would really appreciate if you could help me :) I'm very stuck and don't know how to proceed. I have a custom post type called event and 2 custom taxonomies registered for it: event_type with ...
1
vote
3answers
3k views

query_posts for child pages

I am having problems looking for info on the codex on how to query for child pages. It seems to be missing the reference for the available parameters
1
vote
1answer
1k views

Is it possible to query_posts using post__in and then Loop through them in the ordered they were queried?

query_posts( array ( 'post__in' => array( 5, 76, 21, 56, 3 ) ) ); I'd like to query the Loop using post__in and a set Wordpress IDs. I'd then like to run through the Loop in the exact order of ...
1
vote
1answer
2k views

How to insert content from another Custom Post type into Post?

Say I have a custom post type called "Performers". This gets populated with different bands/performers. These posts have a featured image as well as custom fields (mp3 file, facebook link, myspace ...
1
vote
1answer
9k views

using multiple meta_key and meta_value in query_posts

how can i use multiple meta_key and meta_value in query_posts? For example, I want to find multiple content with two different meta_key and meta_value. How do I do this? i using this code but not ...
1
vote
1answer
47 views

How can I sort homepage by a meta value?

I am trying to sort my home page posts by a custom meta value. I've been told I should use pre_get_posts but I seem to not be implementing it correctly. This is what I am doing: ...
1
vote
1answer
590 views

WordPress get posts by date without query_posts

I'm want to get posts from the last 30days in a sidebar but I don't want to use query_posts, is there a way to achieve this with the get posts function?
1
vote
1answer
841 views

How to query a custom post type with a taxonomy filter but display post type archive page?

I'm filtering the main query of Jigoshop with my own taxonomy with this hook (The file responsible for Jigoshop queries that I'm hooking, Jigoshop hooks onto WP 'request' filter): add_filter( ...
1
vote
1answer
180 views

How to paginate posts correctly that belong to a particular category and are random ordered

I was interested to read the answer to this question on how to paginate posts correctly that are random ordered. Is it possible to paginate posts correctly that are random ordered? My goal is to ...
1
vote
2answers
730 views

Create dropdown list post

I want to create a drop down list that will list all the posts in the category. I want the drop down list to appear on every post. So for example if I view a post that belongs to category Apples it ...
1
vote
1answer
396 views

Sorting multiple custom post types without a meta key/value pair by sort order

At this current moment. is it possible to sort multiple custom post/page types without a meta key/value? I'm looking to just sort the posts by page attribute order: What have i done so far? I've ...
1
vote
1answer
36 views

I would like to give special promotion for the first 100 posts in my blog? Can anyone tell me how to do that?

My website is a multi author blog. I would like to give special promotion for the first 100 published posts in my blog? What is the proper way to implement it? I mean should i add some meta value ...
1
vote
1answer
224 views

Custom post types instead of regular post's categories in a page template

So I got this template which originally queried regular WP posts by their categories so that the page would show a category name for "category 1" as a headline and then posts from that category below ...
1
vote
1answer
1k views

WP_Query last five posts, simply ordered by meta_value

I can't believe I'm asking this question. It feels like such a simple method, yet I've poured over the WP pages and dozens of similar questions to no avail, so here it is... I've got a WP_Query with ...
1
vote
2answers
3k views

Working with query_posts ( arrays and query strings)

I'm trying to use the search query along with an array of arguments to narrow down search results, but I'm failing horribly. This is what I have so far. $paged = (get_query_var('paged')) ? ...
1
vote
2answers
224 views

Tricky WP Query

I am trying to use wp_query (or another native Wordpress query class) to do the following: get all posts WHERE ( post_type = 'post' AND category = 7 ) OR ( post_type = 'case-studies' AND meta_key = ...
1
vote
1answer
1k views

Wordpress pagination showing same posts on each page

I need to make adjustments to a horribly written WP theme that (a custom theme that was written in tables, and bad code). The theme has several custom templates, but pagination wasn't used and ...
1
vote
1answer
3k views

Wordpress query_posts and orderby page order

I have a page that lists all sub pages of the current page. Each page has been assigned an order number in the wordpress editor but they aren't ordering for some reason. I'm set up like this: ...
1
vote
1answer
451 views

IF.. post meta show… Conditional Tag Help…?

I have the following conditional tag, which a friend helped me with... Currently it works doing.. 1) If a featured image just show that. 2) If images attached show featured image wrapped in a link ...
1
vote
1answer
2k views

tax_query operator woes

I am trying to filter posts by multiple taxonomies. My code below works great, but their is one thing I can't quite figure out. When I filter the posts it seems that they only show the posts that ...
1
vote
1answer
842 views

Custom Post Type sorted by Title

I created a non-hierarchical custom post type and, by default, it's sorted by date published. I know I can reorder them by Title with query_posts() in the archive template: global $query_string; ...
1
vote
2answers
643 views

cannot get multiple loops using tax_query

I am trying to get three loops to display. they all belong to the same post type and the same taxonomy family. but i'm trying to separate the taxonomy by three different values. $argsOwners = array( ...
1
vote
2answers
411 views

Placing post data (title, date, and excerpt) nested in static content

I apologize if this is a newbie question, but I am very new to working with WP template files. I am working on a campaign site (that I unfortunately can't show you before the launch in a couple ...
1
vote
1answer
199 views

previewing my posts on static page?

I am new to WP. What i allready have - I am building a news blog with few posts categories. each category function as a different section (Economics, Sports etc.) What i want to achieve- What i ...
1
vote
2answers
440 views

Exclude newest post from category X but show rest

I would like to show all posts but only exclude the NEWEST post from the 'Featured' category, other posts from this cat should display. Any idea what I should add to the loop to achieve this? I want ...
1
vote
3answers
683 views

WordPress Custom Query

I have posts that use a custom field for start date and end date. query_posts returns an array of posts that exist in the category I'm filtering. How do I query posts using this custom field that has ...
1
vote
1answer
1k views

Order query by meta_value with multiple custom fields

I would like to get ordered all my posts with multiple cutom fields (WordPress 3). Exemple, I've 2 custom couple meta_key/meta_value : " order_submenuexpositions / numeric " " ...
1
vote
2answers
610 views

query_posts() ALWAYS displays something?

OK, I'm using posts_query() to display posts. The problem is, at least in my case, posts_query() always outputs something. For example: <?php $paged = (get_query_var('paged')) ? ...
1
vote
4answers
1k views

Wordpress Posts Out Of Order after 3.1 Update

The first posts I wrote are now showing on the homepage. After Googling, the problem is because I am using query_posts to exclude a certain category on the main loop. <?php ...
1
vote
2answers
4k views

query_posts and only show results if a custom field is not empty

How do I query_posts and only show results if a custom field is not empty or has a value. I want to put in a url in a custom field and only show these pages if there is a url? current code but I ...
1
vote
2answers
1k views

How do I correctly get all posts within the last year using the query_posts function?

Specifically, I am making a custom rss feed. I have modeled it after the rss2 feed that is in the wp-includes folder. I can successfully retrieve all posts using the standard ...
1
vote
2answers
260 views

Showing Post Counts of One's (Author) Own in the admin post list

How can I show user's post counts of one's (Author) own in the admin post list (edit.php) instead of all post count of the system? like published (10), Draft (5) ... of his own or logedin user. ...
1
vote
3answers
2k views

Query on custom field count?

I have the following code: <div id="pc" class="smartbar-content"> <ul class="smartbar-items"> <?php $paged = ( get_query_var('paged') ) ...
1
vote
2answers
2k views

Query posts by category AND custom field, then ORDERBY another custom field - help!

OK I need to query posts using the following criteria: category_name=office, meta_key=featured_post, meta_value=Yes and order these results using a second custom field which has a numerical value ...
1
vote
1answer
1k views

Trouble with get_next_post() get_previous_post() returning null

I'm using wp as an engine to put blog features in an existing site. I have a place in the blog page where I load wp-load.php. I want to get the next and previous posts, but when I load a post from ...
1
vote
1answer
670 views

How can i display the posts per week in a particular month?

I have to display the posts as the following September 2010 Friday September 24, 2010 post1 post2 . . . Friday September 17, 2010 post1 post2 . . . Friday September 10, 2010 post1 post2 . . . ...
1
vote
1answer
30 views

WP query exclude post within the last month / only show over 1 month old

I need to create a landing page which only shows posts that are at least a month old. Everything I've read / tried with the date query so far seems aimed at including posts between the last month ...
1
vote
1answer
40 views

How to query_post custom posts within default taxonomy?

I'm trying to query_post custom posts. It works very good with custom taxonomy, but not with default "category" taxonomy. I tried using "category_name" and "tax_query", but it doesn't work for me. ...
1
vote
1answer
139 views

Wordpress Custom Query to show posts from last x years

I have found a way to show all posts from the current year with this code: <?php $today = getdate(); $lastyear = $today[ 'year' ]; $args = array( //'nopaging' => true, 'paged' => ...
1
vote
1answer
88 views

Get posts between custom dates

I created an event CPT and a meta box with a date. I saved the date as post_meta in the form dd.mm.yyyy. Now I want to create a shortcode that queries all posts which's dates meet the condition ...
1
vote
2answers
131 views

Trying to find a way to query post like normal search would do. within search.php page

I have a costume search in a site i am making. When a user search a certain term, i want to display category list with a count of how many posts are found with in that category. I thought of a way ...
1
vote
1answer
602 views

Using loop pagination on single.php

I want the main front-page loop to show in a section on both index.php AND single.php templates, with pagination. Pagination works fine on the homepage, but not on single posts. This is the code ...
1
vote
1answer
159 views

using post__in allow duplicate post id

I have an array of ids in a specific order. I use post__in in my query to get posts from this array. I have some duplicate post IDs that I need to show twice in the page but the query seems to ignore ...
1
vote
1answer
216 views

Custom MySQL Query with logic

I have wp e-commerce plugin installed and custom building custom global search My query looks like this SELECT * FROM aka_v_posts LEFT JOIN aka_v_postmeta ON aka_v_posts.ID=aka_v_postmeta.post_id ...
1
vote
1answer
38 views

child of post type (custom)

I registered a custom post type (foo) with register_post_type, setting 'hierarchical' => true,so now when I want to use it I have post_type=foo. How can I query child of foo? any ideas? thanks!
1
vote
1answer
731 views

query_posts and custom taxonomy posts order

i have a custom taxonomy defined for "Projects" and a page that shows all the projects. In this page there's a jquery filtering menu (isotope). Initially the page must show all the projects but ...
1
vote
1answer
2k views

Filtering custom taxonomies

This is a cross post from the WordPress forums, which I apologize for, but it has been almost a week and not getting any response there so hoping someone here can help. If I do get a reply in either ...