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

Display post thumbnail for specific category outside the loop

I'm building a theme that features a section wherein I'd like to have the single most recent post's thumbnail of a single category displayed between the header and blog sections. Something like ...
0
votes
1answer
25 views

wordpress taxonomy results

I am using taxonomy.php to fetch some rows from database. On taxonomy page the function get_queried_object() shows that I have got the right results from database but wordpress loop if ( have_posts() ...
0
votes
1answer
77 views

Pull Instagram images into an existing loop?

I am looking for a solution to pull Instagram images (from a single account) into a Wordpress loop and mix them chronologically with standard posts that will have been created within the Wordpress ...
0
votes
2answers
89 views

Identify the page being shown while in The Loop

In my loop, I'm trying to set it so that certain text is displayed on certain pages, if there are no posts to display. I thought this would be simple, using is_post(), but it seems that this function ...
0
votes
1answer
94 views

My custom query not detecting the correct category

For category.php my custom query code isn't displaying the posts from the correct category. I have a parent category called 'Blog' and it can have any number of unknown children. With that in mind ...
0
votes
2answers
121 views

Showing related posts (custom post type) outside of the loop

I'm trying the following (it's a sidebar widget in the Single New template): <ul class="featured-jobs"> <?php $postid = $post->ID; $categories = ...
0
votes
1answer
45 views

Looping taxonomy in taxonomy?

So I have a CPT of references (like a dictionary kind of format for music). In it there are two taxonomies: medium_reference and reference_letter. The reference_letter lists letters A-Z, while ...
0
votes
1answer
136 views

next_posts_link returns same content of 1st page

Pagination seems to work fine... I have 21 posts... and it will go to 3 pages... however... every page shows 10 posts and the same content as the first page.... <?php $temp = $wp_query; $wp_query= ...
0
votes
3answers
2k views

Pagination not working on home page

I've a page named "share" with a complex loop that's working perfectly. This page is located at domain.com/share. Now I need to use this page as the home page, so I went to "Settings -> Reading" and ...
0
votes
1answer
170 views

Why is the output of a call to the_excerpt different when the call seems to be identical?

Ok I've been asked to fix a problem on a website that is a bit weird. The index page (template-magazine.php) here, Has this bit of code: <?php get_template_part('loop'); ?> to produce a ...
0
votes
1answer
42 views

Custom Loop and Standard Blog Loop Issue

I am working on a theme with a front page that will have two loop sections. The first will loop three posts from a Custom Post Type (ill-portfolio), the second will loop three blog posts. In both ...
0
votes
0answers
34 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
84 views

Get post category as a separate string and url

I need to figure out how to get post category as a string and link, both separate from each other. So the return would be something like: Uncategorized http://link-to-the-category.com however both ...
0
votes
1answer
130 views

Cant' Display Custom Post Type Title Base on Tax Terms

Trying to list all Custom Post Type titles based on filtered Custom Taxonomy Terms I am getting the list of all post titles instead of getting the list of Queried post. Here is the code I am using: ...
0
votes
1answer
226 views

Insert/sticky specific post into Loop at specific location

I'm having a hard time determining the first direction to take with this. I'm trying to write a plugin that allows users to pick a location for a post to be inserted into the homepage. For example a ...
0
votes
0answers
75 views

Same Loop on Multiple Pages

I have my main loop (loop-entry.php) pulling to my index page which is my homepage on this site: http://snippetmagazine.com/ when I tried to copy that loop and create (loop-blog.php) and included it ...
0
votes
0answers
107 views

For loop logic for combinations

I have WP E-Commerce installed and I'm moving whole it's dashboard to frontend. I have everything ready and am on the last part. In fact I thought this part was ready, until I added two variations, ...
0
votes
0answers
15 views

WordPress site with custom theme, can't get pagination to update posts on page 2+ [duplicate]

I have inherited a WordPress site which has a custom theme which I have in the main been able to modify to suit the clients needs. I am having trouble, however, with the pagination of the ...
0
votes
1answer
44 views

Pagination when using multiple loops

I've populated my index.php with various post loops and I want to be able to get pagination working. The reason for multiple loops is because I'm pulling in posts from different categories in ...
0
votes
1answer
169 views

display only parent replies count in index.php

Currently my posts display the total count of comments (i.e both replies and sub-comments). I want to display only the number of reply count in my index.php (and not comments for a reply) for each ...
0
votes
0answers
320 views

Showing sticky posts with get_posts()

I'm using this to retrieve posts on my index page: <?php $posts = get_posts( "category=13&numberposts=2" ); ?> <?php if( $posts ) : ?> <?php foreach( $posts as $post ) : ...
0
votes
1answer
163 views

Pagination - works on local but not live dev!

Can anyone please shed some light as to why the following to print out page numbers works on my local dev server but not on my live server? Both server are running same version of PHP. My Loop ...
0
votes
1answer
83 views

Custom loop won't work, can't find problem

I can't figure out why this custom loop isn't displaying for me:. I've tried removing the if statement and removing certain query parameters but it just won't display. If I delete the loop entirely ...
0
votes
1answer
199 views

Repeating Loop on my Posts Page

I have a problem with my loop.php, it keeps on repeating posts. I'm guessing this might be controlled outside of this loop.php as it happens no matter what I try. Could someone please advise me as to ...
0
votes
1answer
69 views

How to close open divs in post loop

I want to add some additional HTML markup to specific posts in a loop. For example in the post loop, I want to wrap the post 3, 4, 5 in two divs .extra and .extra2 I want to display post in following ...
0
votes
2answers
115 views

Getting rid of the blog page entirely

My goal is to not use a separate blog page but end up with a structure like this... http://domain.tld/page/comments/ I believe I can do this with the Cornerstone plugin ~ [ ...
0
votes
1answer
60 views

The normal loop with different styles doesn't work in search.php

This code in the search.php file does not work: <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?> <?php if( get_post_type() == 'post' ) {?> <div id="post"> ...
0
votes
1answer
1k views

Child Pages Loop

If anyone can help that'd be great. I've found a snippet of code that I've used which is pretty much doing what I want it to do, which lists out subpages of the parent, adds a thumbnail if there is ...
0
votes
1answer
397 views

Custom post-type's pagination not working in category.php

I have this code to the file category.php : <?php get_header(); ?> <div id="content"> <div id="all"> <div id="todo"> <?php $my_query = null; $paged = ...
0
votes
2answers
56 views

I want my post to republish again after adding a custom field

I wanted a code in Wordpress that could allow me to republish the post every time I add a new custom field. For example, if I already have a post and wanted to add an update to it; I want it to appear ...
0
votes
1answer
107 views

Changing the loop w/o killing category links

OK. I am going to try to rewrite this. I am trying to use the Gridly theme as a mobile only theme for my site. The problem is the theme pulls all post categories into the main feed when it is ...
0
votes
2answers
33 views

Checking conditionals

We all know about the default WordPress post types, these being aside, gallery, status, chat and so on. any good theme should support all of them. In the case where a theme does support all of them, ...
0
votes
2answers
140 views

show posts from one category with comments only

Would anybody have a good idea for getting the WP to spit out all posts from a category with (approved) comments only? I have an ecommerce site set up, and treat comments on product posts as ...
0
votes
1answer
73 views

Pulling in a particular post into a single page based on the post id passed into the code

I currently have a page on a site that I am developing and that contains a loop which loops through 4 posts contained in a custom post type called Treatments. ...
0
votes
1answer
208 views

2 loops in blog homepage

I would like to have to query loops running on my blog homepage: Featured posts on top displaying 3 posts from the category : "Featured" Underneath it just the basic loop of wordpress which display ...
0
votes
1answer
198 views

Order custom posts by taxonomy?

I have the following custom post types: books, documents, examples, guidebooks, onlineaids. They were generated by the following code: ...
0
votes
1answer
18 views

using the loop on a page

I'm trying to display the excerpt of the most recent post and just the titles of the 4 previous posts before that at the top of a page and display the content of the page below. I have a solution ...
0
votes
1answer
376 views

If Loop has odd number of posts on last page Custom style for last post in it

My loop displays posts in two columns using this php <?php if (have_posts()): while (have_posts()) : the_post(); $count++; ?> <?php if ($count == 1) : ?> <div ...
0
votes
1answer
40 views

Noob Loop Question

I come with a basic question but I can not solve, I think that will be easy for you. I would like, if I have 2 or more post on loop, show the entire loop. I tried the following: <?php $paged = ...
0
votes
1answer
125 views

Categories and page filtering with pre_get_posts

I have 3 pages, "Page 1" shows custom post-type "articles", "Page 2" shows custom post-type "tips", and "Page 3" shows both custom post-types. This is done conditionally with a custom loop in ...
0
votes
1answer
44 views

Loop not showing up on page template

I have a page template and on the page I have a loop such as: query_posts('post_type=post&posts_per_page=5&paged='.get_query_var('paged')); if(have_posts()){ while(have_posts()){ ...
0
votes
1answer
92 views

Filter Category Loop Dynamically

I'm trying to display a custom loop with a dynamic category filter. As a setup I have categories of all usernames which are created once a user creates an account. So I am trying to echo the user's ...
0
votes
1answer
55 views

Remove the_content From Loop

I'm trying to display a custom loop with only certain elements in it. My loop currently contains the title, creation date, author & content. However I am trying to remove the content for each ...
0
votes
1answer
101 views

Display multiple custom post type lists on homepage - multiple loops

I've got to display 6 boxes on the homepage of a site I'm working on and struggling with the code. I've managed to get this far: <?php $term = get_term( hotelCategoryID, 'accommodation-category' ...
0
votes
1answer
914 views

Pagination on category.php and tag.php not working

i'm using a query-loop on my template pages like this: <?php $paged = (get_query_var('paged')) ? get_query_var('paged') : 1; $wp_query = new WP_Query(); ...
0
votes
3answers
72 views

Trying to display ads on only a third of posts in a loop. Keep getting Error 500?

I'm thinking it's just a PHP code error, but for some reason the following code won't work, it just keeps giving me Internal Server Error 500 <?php $ajfl_adLuck = rand(1,3); if ($ajfl_adLuck ...
0
votes
1answer
3k views

Loop through multiple custom taxonomy terms and display posts for a custom post type

I am working with custom post types in the bones theme from themble. There, I want to create a link list and therefor i've created a custom post type, called links. This custom post type has a custom ...
0
votes
1answer
72 views

single.php fires more than once after clicking on any post to view with different post id each time

I am now experiencing a wired problem with my wordpress installation. I was surprised when I saw post view counter of another post also increased including the the post on which I clicked to try and ...
0
votes
1answer
222 views

Custom Meta Box If Else Statement

I have created a custom meta box for posts and I need to display said data. I have been using the below method to display the data, But I am in need of a slightly different solution. <a ...
0
votes
1answer
87 views

Custom loop page with post navigation

I created a custom loop for a particular category. Can I create a list of those posts -- kind of like a table of contents -- and have it link to that service in that loop? Pagination is not used. My ...