Tagged Questions
0
votes
0answers
19 views
Run a query when in last category
Can anyone help? ive searched google but with no luck.
currently Accounts has sub categories but no posts
/accounts/ = /billing1/ + /finance/
Billing and finance have posts but don't want ...
0
votes
1answer
65 views
Specific Loop For 2 <div> Within Each <li>
I need to create a loop that can logically be described as the following for a carousel:
Requirements:
3 Loops
2 Posts Per Loop
No Duplicates
Order by Post Date
Visual:
< Start Loop #1 >
...
0
votes
0answers
19 views
Listing custom post type items from a couple of custom taxonomies
I know I have asked a similar question in the recent past (Listing all custom post types using a specific term on the said term's template page, in groups), but in this case, the template is more ...
0
votes
1answer
126 views
Upcoming Event: How do I sort database by custom date field, but ignore past dates?
I am using an events plugin and struggling to get my database query to be perfect. The query is on the event-single.php template. What I need the query to do:
Query the "events" custom post type ...
0
votes
1answer
22 views
Custom Post type showing up in loop, regular posts are not showing up
Every one knows the basic WordPress loop, every one knows that if you want just posts in a loop you put query_posts("post_type=post"); BEFORE the loop. which I have done.
The problem is I have a ...
0
votes
1answer
41 views
WP_Query: query posts by ids from array?
I did quite a bit of research but can't figure why this wouldn't work for me?
echo print_r($rel); // Array ( [0] => 63 [1] => 87 )
$args = array(
'post_type' => array( 'post' ),
...
1
vote
2answers
65 views
Query reset problem or flawed code to enable custom post type query
After reading through here and trying various options, I am finally able to get my custom post types 'testimonial' (created with product 'Toolset') to show along with my standard cat/tag queries ...
2
votes
2answers
116 views
Rearranging posts based on categories
Hey everyone on Stackexchange!
I'm trying to find a way to prioritize posts based on a category in a loop, which is sorted by dates. All posts are grouped under their respective dates. The date ...
0
votes
2answers
760 views
Listing custom post types on archive page with array
I'm just starting to wrap my head around custom post types and for some reason can't get any of the custom post types to display in the loop. I've found some queries online but none of them are in ...
0
votes
1answer
62 views
Exclude posts based on an array
I'm using a custom meta box to output a list of post IDs within a particular post type ("Publications" in this example). Is there a way I can output this array into a custom loop to only show posts ...
1
vote
1answer
84 views
Loop after page content
I just upgraded to 3.4.2 from 2.9 (i know, i know, but if it ain't broke...) I have page templates that are (or at least were) set up to display the page content first, then start a loop of posts, ...
0
votes
1answer
151 views
Loop to display random posts only if a custom field matches category
Working on a website and need loop that will show posts ONLY if custom field value is equal to the current category name.
I have category 'fun' and custom field 'genre'. I would like to show on ...
2
votes
2answers
196 views
Splitting the main query in multiple loops with query_posts and/or pre_get_posts?
I have a custom post type 'events', to which I have associated a custom taxonomy 'calendar'. The calendar has 12 fixed terms, for each month of the year ( 'august', 'october', 'november, etc.).
I'm ...
1
vote
1answer
347 views
Is there any need to use both wp_reset_postdata and wp_reset_query together?
Is there any need to use both wp_reset_postdata() and wp_reset_query() together?
Is it a case that I would pick one of the two functions; is there any point in doing this after a query :
...
2
votes
1answer
701 views
WP_Query vs get_posts
I have read a number of questions on SE regarding these but I still can't figure the exact difference wrt usage. Would it be true to say that I would probably use WP_Query for the majority of ...
0
votes
3answers
281 views
Split wordpress loop to multiple layouts
OK so I've searched a lot and couldn't find a straight forward answer to my question.
I am simply trying to use one category loop that will display posts in a category page in a wordpress site. lets ...
1
vote
1answer
221 views
Display category posts grouped by taxonomy
I'm working on a project where I use the default posts as "Products", default category as "Application" and a custom taxonomy called "Groups".
I want to list "Products" by "Application" ...
0
votes
2answers
125 views
Transient api Caches confused
This code works for page 1
<?php
$paged1 = (get_query_var('paged')) ? get_query_var('paged') : 1;
$recent1 = get_transient( 'recent1' );
if ...
0
votes
1answer
86 views
Query post & loop problem.
i having trouble while i added query to loop.
please have a look whats the problem.
here is the link
<div class="fl" id="main_article">
<?php $count = 1;
$the_query = new WP_Query( ...
0
votes
1answer
108 views
Conditional category query breaking?
In my loop.php (see below) I basically have a condition where if the page is not paginated (i.e. if the URL does not look something like this: example.com/page/2) then display 2 posts with a category ...
0
votes
1answer
230 views
Get all pages to display at once
I'm doing a theme that is supposed to be ease to create, but I have now reached a standstill and need to get past this.
Is there a way to display/show all pages at once? Or can I create a custom ...
0
votes
1answer
424 views
How to Loop within a Loop (Display Children and then Grandchildren)
I am trying to develop a query for WordPress that will allow me to display a list of child pages with titles only, and then under each child page title, a list of grandchilden (children of the child) ...
2
votes
3answers
466 views
Wordpress query by category, sorted by custom field
I have three custom fields set for each of the posts in the events category — year, month, and day. I am already querying for the events category, and now I'd like to sort the posts by the custom ...
1
vote
2answers
105 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
1answer
175 views
How to get the term description in a taxonomy term archive query?
I'm creating a template for a custom taxonomy for my theme.
At the beginning of the page, before the loop that lists all the posts associated to a term of that taxonomy, I want to output the ...
0
votes
2answers
390 views
Wordpress loop: Display <div> if posts exist
In a single post template I am trying to output some header text in a <div> and display links to related posts in a <ul> if related posts exist (based on tags). If there are no posts, ...
0
votes
2answers
261 views
wordpress showing all posts instead of date range
When going to http://craigmdennis.com/articles/ Wordpress uses the index.php template.
When you go to http://craigmdennis.com/2010/05/ Wordpress uses the same template (markup below) but shows the ...
0
votes
1answer
409 views
Changing WordPress sort order for returned child pages
I have a custom WP_Query that looks like this:
$this_page_id=$wp_query->post->ID;
$images = new WP_Query( array( 'post_type' => 'menu-item', 'post_parent' => $this_page_id ) );
My ...
1
vote
1answer
388 views
Is it possible to have pagination with an offset loop?
I am developing a blog page that requires 3 different post styles (Ie; one full page width with featured image and content, one full page width without featured image and the rest are half page width) ...
1
vote
2answers
2k views
How to use a custom post type as front page?
I would like to set a site's front page to be a single post from a custom post type. I have been able to alter the request for my front page to a Custom Post Type archive with the following code ...
0
votes
1answer
245 views
Get current taxonomy and display query accordingly
Okay i'm having a bit of a catogorisation/taxonomy/filtering problem here and am at loss on how to solve this.
I hope someone could help me on the way a bit.
Say I've got a blog about food, with a ...
0
votes
1answer
406 views
Add custom post type to query
$saved = $wp_query; query_posts(array('tag__in' => $tag_array, 'showposts' => $args['posts_per_page']));
I need this to query standard posts and a custom post type called "property"
I can't ...
1
vote
1answer
134 views
Help with Wordpress Query
I'm sort of a noob when it comes to Wordpess; I've only recently started building themes and I've run into a wall. I'm trying to feature 3 different articles at the top of my site using wpquery and ...
0
votes
2answers
567 views
How to setup a query to output posts by groups of five?
I'd like to have a query that returns posts grouped five by five.
Right now I have a simple query loop like this one :
<?php if( $query->have_posts() ) : ?>
<ul class="posts">
...
3
votes
2answers
219 views
Identify which loop you are hooking into; primary or secondary?
What is the most efficient way to determine which loop I'm in?
I have a few plugins that alter the query by hooking into various parts of WP_Query::get_posts(), through the usual suspects, ie ...
5
votes
2answers
736 views
Usage of the new “posts_clauses” filter in Wordpress 3.1?
Just noticed that 3.1 added a new filter to customize queries: posts_clauses. All I could find about it is that instead of using the separate query filters like posts_where or posts_join, you can ...
0
votes
1answer
218 views
Loops for cat links not looping for wordpress site
I have this code and all the vars pull in but the latest news is not showing up and the subscribe link is not dropping anything. any ideas? Everything else works like a charm.
<div ...
1
vote
2answers
489 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')) ? ...
10
votes
3answers
8k views
Pagination not working with custom loop
I've got a custom loop that I'm using to display some Real Estate listings that will be available within 60 days. I'm calling it with the following function:
<?php
$sixtydays = date('Y/m/d', ...