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
168 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
221 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
39 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
749 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 ...
1
vote
1answer
313 views

order post my meta value m/d/y format with year as included value

current order: 01/01/2013 12/07/2012 12/08/2012 . . . . 12/31/2012 ------------- 01/01/2013 should appear last My code: $paged = ( get_query_var('paged') ) ? get_query_var('paged') : 1; $today = ...
1
vote
2answers
306 views

Query Posts Exclude Entire Category

I am using the standard wordpress loop that looks like: <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?> <h2><?php the_title(); ?></h2> ...
1
vote
2answers
299 views

Page template with different page and post content

I am using a wordpress theme which has a page template named roomtypes. I am not a php pro but as far as I understand this template gets the posts. When I add a Room type, it is created as a post with ...
1
vote
1answer
380 views

How to use custom taxonomies to reference complex relationships?

I'm working on a site that will in part house information on products that many people have worked on in different roles. I'd like for people, the projects they've worked on, and their roles in the ...
1
vote
1answer
130 views

Show 1 post and after a specific date show the next one

I used the following query to have only 1 post published on the homepage from a particular category: <?php if ( have_posts() ) : ?> <?php ...
1
vote
1answer
309 views

Author List page: Exclude based on last post date

I have a Author page that I built using this code and it works fine. However, I have several writers that range from frequent to one-time writers. I would like to seperate out writers that have not ...
1
vote
1answer
424 views

is there a way to show the the post title after the image?

Trying to show the post title after the image in the main blog page and single page, I have tried to edit the content.php but unable to achive the result I need, which is basiscally IMAGE TITLE META ...
1
vote
1answer
169 views

Logged in user ID as post ID

Is there a way to automatically insert the current user ID as the post category name or maybe have WordPress display only the post with a category name that matches the current logged user ID? ...
1
vote
1answer
242 views

meta_value_num sort glitch

i have a custom query, and I have a meta key that contains a sequence number: 1.1, 1.2, 2.1, 2.2... 11.1, etc the problem occurs when the numerical sequence gets in to double digits, ie. 5.11, 5.12, ...
1
vote
1answer
866 views

search query within custom taxonomy term, post title and meta field

I want to create a search that does: Search within my custom taxonomy - custom-tags search the post title search select meta field ?? dont know search with custom post type - easy part I looked ...
1
vote
3answers
2k views

Query posts by taxonomy term name

I would love to get the list of posts by their custom taxonomy (=store) name. Here is what I have so far, but it is not working. Please help with the code. $mystorename is a variable holding the ...
1
vote
1answer
2k views

How to order posts by slug using query_posts/ Wp_query

I want to display posts sorted by slug on a page. Is it possible to order posts by slug using query_posts or Wp_query?
1
vote
1answer
213 views

Order query using custom meta data

I have created a custom post type called Events with the name of events function add_events_post_type() { register_post_type("events", array( "label" => __("Events"), ...
1
vote
1answer
204 views

Query Custom posts of same taxonomy as the post itself

I have 2 custom post types: "Services" and "Works" and they both have a same taxonomy 'Genre'. Now the taxonomy 'Genre' has as term called 'novice'. 5 Recent posts under "Works" which has the term ...
1
vote
2answers
112 views

Why is querying posts messing up my pages?

I am working on a theme at the moment and I have set up a post template. This post template is linked to some custom post types. When I query_posts for my post type on the actual post template ...
1
vote
1answer
235 views

Displaying terms based on loop posts?

I have a shortcode that shows a loop for a custom post type: while ( $loop->have_posts() ) : $loop->the_post(); // do something endwhile; Some of the posts are in categories ...
1
vote
1answer
197 views

Get latest 3 posts from multiple CPT in one query

I'm looking to create a site wide feed on my site and have multiple custom post types. I'd like to display say 3 posts from at least 3 different post types. I can get the latest 10 posts across each ...
1
vote
2answers
1k views

Using Query Posts With Multiple Post Types And A Taxonomy

I am developing a site that has two different custom post types; one of them is called Articles and one is called Sketchpad. Sketchpad is user submitted content that is assigned a custom taxonomy term ...
1
vote
1answer
434 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 ...
1
vote
1answer
256 views

Display all posts that were published before full post on single.php

The way I would like my blog to work is a user clicks on a post that was published on 12th March 2012 (for example) they get taken to single.php where the content of that post is displayed as normal. ...
1
vote
1answer
167 views

get custom post type

I am using this code to get custom posts in rows. <?php query_posts('posts_per_page=72&cat=' . $cat . '&order=ASC'); $columns = 5; $increment = 0; ?> <table class="cat"> ...
1
vote
1answer
236 views

Category Foreach keeps looping?

I'm using the following code to acquire all the child categories of a category and displaying the child posts of the child categories. <?php $cats = get_categories( 'child_of='.get_query_var( ...
1
vote
1answer
9k views

How to show related posts by category

In my gallery site i want to show other pictures under the current picture (in single post). I seen more codes but it i asks to specify the category, but i dont want want specify the category manually ...
1
vote
1answer
615 views

How to make “sticky” pages (and query by them)

I have query_posts() with page_type set as 'page'. Is there any way I can make certain pages appear higher and thus, make them sticky?
1
vote
2answers
4k views

Number of posts per page setting is not working?

OK, here's my prob. I have static homepage and a separate posts page on my wordpress site. I have defined the two in the admin panel. Now, I have also set the max number of posts to be displayed to ...
1
vote
1answer
1k views

Sort query_posts for Parent Pages to menue order or the count?

thanks to a member here i display my Parent Pages in a 2 column grid with title and excerpt. But for some reason i can't figure out how to sort all 5 Pages by the menu order for example or the order ...
1
vote
1answer
726 views

Custom Query num_rows returns wrong amount

So I have a custom query that fetches all posts in a given category. I am trying to get the number of rows returned but it is giving me the wrong number. Instead of 11, I am getting 14. Does anyone ...
1
vote
1answer
753 views

Wordpress Search Filter Only for Page with Child of Child of Child of Child of Child

after browsing question from this site I found the workaround for this: function SearchFilter($query) { if ($query->is_search) { global $post; $query->set( 'post_parent', 21 ...
1
vote
1answer
1k views

how to exclude “featured” posts from the main loop?

In a category.php template, I built a function that lists "featured" posts before the main loop. The featured posts are selected using a custom field and get_posts(): function ...
1
vote
1answer
302 views

Search breaks when querying main loop for category

In my theme I provide an option for users to set a 'blog category' that queries and displays only posts from that category on index.php using WP_Query: $shortname = get_option('of_shortname'); ...
1
vote
1answer
447 views

Query_post($args)

it is possible to use a array by the this query? This Version doesnt work: $args = array( 'order' => 'ASC', 'meta_key => array('city_1','city_2), 'meta_value' => ...
1
vote
1answer
999 views

how to query posts and auto assign category if post title has keyword

how can i query posts by current date and auto assign category based on keyword found on post title, something like if title contains 'oranges' auto assign it 'oranges' category maybe something like ...
1
vote
1answer
6k views

Wordpress pagination with get_posts?

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
2answers
535 views

How do I call posts with a certain tag?

I use this to call posts: <?php $paged = (get_query_var('paged')) ? get_query_var('paged') : 1; $per_page = get_option('to_count_archives'); ...
1
vote
1answer
720 views

Authors List page - How to include only those with wp_user_level as Author

At my Authors template page, I want to show a complete list of Authors only (i.e. wp_user_level=2) the code I used is like this: $current = (intval(get_query_var('paged'))) ? ...
1
vote
1answer
458 views

Authors List page : how to exclude posts from certain category

I have a magazine wordpress site in which I have designed a separate page to show all the authors with their nice_names (with URI) and no. of posts. the code is like this: $current = ...
1
vote
1answer
1k views

Using ajax with paging and a custom sub-query

I have a page that uses three queries to retrieve a variety of content. One of those queries grabs posts that are related to the topic of the page. Since these posts can be of all sorts and related ...
1
vote
1answer
779 views

How to limit search to first letter of title?

I was wondering if there was a way to make the search only look for the first letter in the posts title, basically let's say my search query is www.mysite.com/?s=q I'd like to get all posts that start ...
1
vote
2answers
1k views

Conditional Query of Custom Post Type and custom taxonomy

I am working on a project that has a custom post type called 'Experience Statement' Custom Taxonomy attached to that post type called 'Expertise' 6 different terms for the custom taxonomy: Coastal, ...
1
vote
3answers
456 views

will post_id ever change? Can I safely use post_id for custom queries?

What are the best practices for using post_id? Can I use this safely in my templates to call specific posts, or will these post_id's ever change? The reason I ask is that randomly today the ...
1
vote
2answers
338 views

Get post and all posts after it by ID?

Maybe this is super obvious and staring me in the face, but I'm stumped. Is there a way to pull and sort posts by ID? I'd like to grab an arbitrary post, and then x number of posts after it. ...
1
vote
1answer
613 views

sort posts by alphabetic plugin suggestion

I am looking for plugin to sort posts by alphabetic orders. Sort: A-Z Z-A Newest Oldest and option to view per page like in stake exchange websites Per Page: 20 40 60 All if not exists, can i ...
1
vote
1answer
1k views

Function to show random posts from a category

Hi to all I'm trying to create a function that can ECHO the excerpt of a random post from a choosen category. What I did up to now is: <?php function $titoloslide() = { ...
1
vote
1answer
1k views

How to select posts from multiple categories and metavalues?

I need to select posts who are in multiple categories and have certain post metavalue. I can select multiple categories with query_posts( array( 'category__and' => array(1,2,3) ) ); But also I ...
1
vote
1answer
112 views

Filter custom posts with / without comments

I need to display (for pages that use a particular page template) a list of custom post type objects filtered into 2 sets - those with comments, and those without comments. Each of these sets should ...