The core of the WordPress query, the loop offers an easy way to access post information and display it on your website.

learn more… | top users | synonyms (3)

0
votes
1answer
668 views

Display different number of posts from one category on the different pages

according with Pagination with custom loop. I use the custom loop for display flash game. For make a pagination on the page with posts from one category (mydomain/category/categoryName) I used: ...
2
votes
4answers
9k views

How to Change Loop to Order Posts by Views (using wp-postviews plugin)

I hope somebody would be kind enough to help. I currently have a page that orders all of the posts by comment count, but I want to change the loop to order the posts by view count. I have installed ...
1
vote
2answers
1k views

Breaking the loop?

WP loops are widely used to print lists of posts in Wordpress: <?php $loop = new WP_Query( array( 'post_type' => 'ff', 'ff' => 'show_ff', 'orderby' => 'menu_order', 'order' => 'ASC' ...
1
vote
2answers
294 views

How do I display the function the_content in this loop?

I have this loop in my wordpress site which displays the latest posts with their titles, I want to display the post content after the title. I normally retrieve it with the function get_the_content ...
1
vote
1answer
622 views

Can I create a loop with multiple post types and specify different $args for each post type?

I'd like to create a custom loop that includes all Post types: Post and Video. Then I'd like to specify to show all posts of the post type Video, but only show posts that are in the category ...
1
vote
2answers
318 views

How to track post number on the_loop

I have a need to customize some posts from the loop. Here's the deal: My site is set to 10 posts per page. On post #2,#5, #7 (on every page), I want to display specific background. What's the best ...
2
votes
2answers
2k views

Ajax loop refresh on click

I display a random post loop on a page. I'd like to put a "refresh" link to refresh the content of the loop via ajax. Is this possible? This is my loop if it helps: <ul ...
1
vote
1answer
381 views

How can I show the post thumbnail from the most recent of a certain post type, in widget?

I'm using the excellent PHP Code Widget plugin, and want to create a widget that displays the post thumbnail (aka featured image) for the most recent 'project' post. Here's the code I have so far, but ...
14
votes
4answers
16k 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', ...
3
votes
4answers
2k views

How can I create an alternative home page?

I'm working on a site which has a fully customized front page. Now I'm asked to add a more classic looking blog type page which will be reacheable at http://domain/blog. I tried creating a custom ...
0
votes
2answers
1k views

How can I change how my tag pages display?

Ok, I'm using the TagCloudShortCode plugin. I have a problem with how my tag pages display.... I want them to display the way they show on my main page, with the image and more button... how do I ...
1
vote
1answer
2k views

Formating the display of a post's date, outside the Loop

I'm using this function to be able to retrieve several data, from outside the Loop: function get_post_data($postId) { global $wpdb; return $wpdb->get_results("SELECT * FROM $wpdb->posts WHERE ...
0
votes
3answers
824 views

How to splice in wp_links links into the loop?

I want to create a loop where 2 or 3 items from my blogroll are spliced in like this: <loop> <post1> <post2> <blogroll1> <post3> <blogroll3> ...
0
votes
1answer
777 views

Problem with WP_Query sort

I have the following custom query written for a page- $menu_loop = new WP_Query( array( 'post_type' => 'page', 'posts_per_page' => 50, 'post_parent' => 616, 'order_by' => 'post_title', 'order' => ...
0
votes
3answers
2k views

How to get the list of posts in a static page other than front page?

So, for the thousands using WP as CMS, a typical approach is that of using the 'A Static Page' option from the Settings > Reading admin page. However, I'm in a different scenario: our front page is ...
6
votes
3answers
5k views

Getting Post Comments for post ID using WP_Query() and a Custom Loop?

(Moderator's note: The original title was "Is there a way to get post comments by post ID on a custom loop using WP-Query()?") Hi! I'm running a custom loop using WP_Query, that only displays one ...
0
votes
1answer
212 views

Is there a way to define the $post var outside the loop?

I am trying to speed up a wordpress site by condensing three wp_queries into one. I have a need to seperate categories, so I am making the call and defining 3 arrays to hold the post using a switch, ...
0
votes
1answer
330 views

Create a Loop with Posts Ordered by Most Recent Comments

Using query_posts, how can I order the list of posts so the ones with the most recent comments are at the top? I'm looking for something similar to how Questions here on SE are ordered when you ...
1
vote
2answers
5k views

Strategy to get post meta for use outside the loop

I need to know solutions for the question above. There are cases, when we need post meta information outside the loop. Let's say, I'm developing theme that will display ads from certain vendor on that ...