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
166 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"> ...
0
votes
1answer
94 views

Notting but the latest post content keeps on being loaded

Im loading post into a content area via ajax but the latest post is the only one that loads, any one encounter this and manage to fixed it, if so please enlighten me. <div class="content"> ...
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
233 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( ...
0
votes
2answers
176 views

why to use query_posts() in custom page?

Hi i am new in wordpress and want to know about query_posts() function. If there is index page or home page than there is no need this function to display post but if i made custom page than there ...
1
vote
1answer
159 views

Show Blogroll of another WordPress site

I am managing a couple of WordPress sites, all hosted on the same VPS, and the client would like the homepage blogroll of Site A, that the own, to appear on Site B that the also own with the same ...
1
vote
1answer
8k 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 ...
2
votes
1answer
393 views

Order by value in serialized custom field

Quite a pesky problem here. I've taken over a site that contains multiple information, serialised, within a custom field. For example: if ($new_query->have_posts()) : while ...
0
votes
1answer
377 views

Count custom post type based on two meta data

I am trying to count my custom post type called 'appointments' that match two meta data values . The meta data keys are 'location' and 'timestamp' So in english my query is: How many appointments ...
1
vote
1answer
336 views

How to remove a plugin filter's priority on specific loops (custom queries)?

So I have a review plugin that is automatically sorting all my site based on the score rating. It seems here are the filters the plugin is applying globally: //Post sorting $sort = ...
0
votes
1answer
224 views

Custom Queries - Child Categories not showing up

What I'm Doing I have a cities category and normal categories. Right now I have them filtering by category, then when the user clicks a city it will filter by category AND city query_posts(array( ...
1
vote
1answer
597 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?
0
votes
1answer
2k views

Filter Posts By Tag

I'm trying to filter my posts by category, then further by city. The only way I can think of filter by city is if the admin adds the city to the listed tags and then filtering from there via switch ...
2
votes
1answer
603 views

query_posts sort in multiple directions

I'm trying to improve my post sorting by using multiple criteria, but I want specific orders for different values. For example, I have a meta_key called 'featured' that I want to move any post up to ...
0
votes
1answer
813 views

How to Get All Posts but the Private ones?

I am creating a frontend mosaic view where i need to show the most recent posts. So i need to show all published posts to every visitor, but keep the private ones for the logged in users. I know how ...
0
votes
1answer
310 views

Exclude categories and subcategories in QueryLoop

I want a QueryLoop that exclude some categories and its subcategories, I have this: $args = array( 'category__not_in' => array( 2, 6 ), ); this exclude the ...
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 ...
0
votes
1answer
2k views

query_posts doesnt show pages with given ID when post_type => page

At the moment I am working on a WP-site, which on the frontpages has 3 excerpts of other pages on it. The code I am trying to use for this is as following: <?php query_posts(array('post_type' ...
1
vote
1answer
20 views

Trying to package posts for republishing by partner offsite

I'm wondering if someone may be able to point me in the direction of a tutorial that can help me deliver my last X posts in X category as a javascript snippet to a publishing partner. I want to be ...
0
votes
1answer
44 views

Calling Posts from Specified Cat

The following is not working to call posts from a specific category and only grab the number of posts selected. I'm using more than one loop on a page as I am using this to create a "featured ...
0
votes
1answer
220 views

Collect posts from last 48 hours

I want to create a custom rss feed <?php /* Template Name: Custom Feed */ function filter_where($where = '') { //posts in the last 30 days $where .= " AND post_date > '" . ...
0
votes
1answer
431 views

How to run a SQL Query for character in Post Titles

Pretty much self explanatory. I have a development server running the latest WP, and I imported a bunch of posts from a blogger account. After the import, every post was titled as such: >Example ...
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
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 ...
0
votes
2answers
2k views

Get posts by meta data OR title

I have a working query that calls all my posts that have a certain meta value for one of two meta keys: $term = $_GET['term']; $args = array( 'post_type' => 'some_cpt_name', 'meta_query' ...
0
votes
2answers
112 views

query_posts - slightly more advanced query

I'd like to edit the front page posts query to be slightly more advanced. Right now it excludes all posts in the Featured category. I'd like it to exclude the first 5 posts (or first n posts, really), ...
0
votes
1answer
89 views

Query Posts Incorrectly Displaying Tags Archives

When I go to a tag archive ( http://themeforward.com/demo2/tag/n/ for example) ALL the posts on my blog are being displayed, not just the posts with that tag - and I'd like to fix this. Here's my tag ...
7
votes
3answers
11k views

posts_per_page no limit

I want to return ALL posts with query_posts. I tried setting posts_per_page to a really high number, but query_posts freaks out and doesn't return any posts. What is the correct way to query posts ...
0
votes
1answer
605 views

Magazine style frontpage with multiple categories/loops and no duplicate posts

I am migrating a static magazine site to wordpress. I would like to have a frontpage displaying multiple categories with a few posts in each, e.g "politics", "environment", "health" and "technology". ...
0
votes
2answers
192 views

Keeping get_posts' offset and is_paged() synchronized

I am developing the blog-template of my theme, which works as following: The user can input the total post-count to display on each blog-page ($blogpost_count). The blog itself lists post-entries in ...
0
votes
1answer
875 views

Custom Post Type Query W/Category Dropdown

I'm having a bit of trouble getting a custom post type query working coming from two drop downs. Let me show you what I'm using: The Form: <?php require($_SERVER['DOCUMENT_ROOT'] . ...
0
votes
1answer
242 views

How can I override one post and make it display content for another post?

I have two pages on my Wordpress site: mysite.com/?p=100 mysite.com/?p=200 I think I should be able to hook into Wordpress' actions somewhere and re-query the post, so that content for ...
-1
votes
1answer
62 views

Sort posts with multiple meta_keys

does anybody know how to filter post by meta_key1 (meta_key1=something) and order by meta_key2 at the same time ? ...
0
votes
1answer
2k views

When to use Wordpress loop or Foreach loop?

Under what circumstances would you, (should you?) use a foreach loop, instead of the wordpress loop. I have no real coding need, but I'm curious. What's good practice here? Should I: ...
2
votes
1answer
555 views

Search stores (custom postcode field) within 5, 10, 15 miles of user inputted postcode.. Code modification

I have been searching for a location search solution for wordpress.. The best semi-solution I have found is http://mondaybynoon.com/2010/02/22/store-locator-wordpress-pods The problem being is that I ...
0
votes
1answer
781 views

pagination in author.php template returns 404 error

Hi to the community!!! I need some help with pagination in author.php template. I have pagination working in all my loops except in authors.php that i get a 404 error. In my settings/reading i have ...
8
votes
6answers
11k views

Wp get all the sub pages of the parent using wp query

Here is my code $my_wp_query = new WP_Query(); $all_wp_pages = $my_wp_query->query(array('post_type' => 'page','post_parent'=>$parid,'orderby'=>'title','order'=>'ASC' )); It displays ...
0
votes
4answers
1k views

Exclude categories from postquery

I asked this question without a clue what was going on. I got an answer with the code below. It worked when I got it. I tested it with shirts only, assuming it worked with the other cats. it doesn't ...
0
votes
1answer
293 views

How to have a category not show up in query post with page panigation?

Basically I have this loop that shows all post. Inside of it I want to exclude post's from categories including shirts and hoodies, also the gallery category. Here is what I have so far. the code ...
4
votes
1answer
1k views

Help to condense/optimize some working code

WordPress by default shows ALL posts to users who are Authors. I wanted Authors to only be able to see their own posts so I came up with the following code which works well. Any suggestions to ...
0
votes
1answer
225 views

Get author total post votes from post meta

In author.php, i have the list with the posts written by the author. I'm trying to get the total number of votes, from the author posts. All posts have a post_meta with a numbered value. i need to ...
1
vote
1answer
704 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 ...
0
votes
2answers
588 views

Post per page not working if no category specified

I'm going crazy... <?php query_posts(array('cat' => 3, 'posts_per_page' => 1)); ?> This shows 1 post (there is two in the category) >> OK <?php query_posts(array('posts_per_page' ...
0
votes
1answer
250 views

Query posts in a category and include only one post per author?

I'm attempting to list posts from a category (a random selection). However, I only want to display one post per author. Thoughts? Appreciate the help.
0
votes
1answer
310 views

2 loops, is_home won't work, count is off

Alright, I've made a bunch of themes over the years, and I've written a lot of queries. And I just realized that I apparently have no clue how to get multiple queries to behave. So, here is the loops ...
0
votes
1answer
84 views

Querying a query

Let's say I have a query stored in a array. I want to parse this array, find the first posts inside this array that match a certain value from a certain key, and so extract the whole post. Is there ...
1
vote
0answers
186 views

Tough Custom query: archive page with custom meta_value_num [closed]

I trying to add parameters to the query string of an archive page. So I verified that the following method works: query_posts($query_string . ...
0
votes
2answers
887 views

How to query blogs posts of WordPress sub domain?

I am using WordPress 3.2.1 multi-user. I need to show posts from a specific sub domain in my home page, for example: http://mysite.com/sub-blog. I need to show posts from sub-blog in my home page. Is ...
0
votes
2answers
838 views

query_posts and sub pages?

I have a Page layout like this Parent Page - Sub page 1 -- sub sub 1 -- sub sub 2 -- sub sub 4 - Sub page 2 -- sub sub 1 -- sub sub 2 -- sub sub 4 I want to query every single child page, ...
1
vote
1answer
732 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 ...