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
27 views

Tags interfering with next_post_link();

I am creating a theme in WordPress. I am using query_posts('tag=front') to limit the posts on the front page. However, I want to let the user navigate through all posts, regardless of tags when on ...
0
votes
1answer
43 views

WordPress Multiple Loop: Home/Archives Page, with pagination

I can not write English, and I'm using the google translator. I believe that pictures can say more than words. Please watch this. http://i.stack.imgur.com/99YKW.jpg is possible to do something? ...
0
votes
1answer
382 views

offset WP_Query by negative 1

I have an event loop and I was wondering if it's possible to somehow offset the loop by -1 so the prev and next posts of the current post are shown. --edit-- Okay thanks for your comments, my ...
0
votes
1answer
54 views

Exceprt not displaying

I am using a custom template homepage in which I want to display some excerpt from a category but it's not displaying as I code for just the_excerpt. I have a confusion too, they say the the_excerpt ...
0
votes
1answer
43 views

Is there a way to target only images within the loop?

I'm new to WordPress and I'm trying to target specific parts of the content. I understand how to grab the title with get_title() — is there something similar for images?
0
votes
1answer
80 views

Placing the content of one post in two side by side columns, newspaper style

I'm trying to place two columns side by side like a newspaper does and display one post's content within both. I've been trying to explode the content at my h4/90 words and echo the rest of the ...
0
votes
1answer
571 views

wp_query orderby random do not repeat infinite scroll - one loop

I have found a lot of documentation on solving this issue with multiple loops, I'm finding it hard to see a solution for one custom loop. Problem: I'm using infinite scroll to load in the next page ...
0
votes
1answer
363 views

Create a custom taxonomy template that loops through child categories in term order?

We're building a site that sells Biking Gear We're using the Genesis Theme Framework, and developing a custom child theme. It has a Custom Post Type for Products, made with the "Custom Post Type UI ...
0
votes
1answer
73 views

Loop to get current parent page “content” and his children content

I am tring to write a loop to get the content of a current-page; and below the content of every children of this page. After reading on wordpress codex website and outside on the web; I can't still ...
0
votes
1answer
230 views

Multisite redirect loop for a single www domain

I have been using WordPress multisite for several years without a problem. At some point in the last few days one of my many multisite domains is stuck in a redirection loop. The domain is ...
0
votes
1answer
154 views

Display First posts without the default featured image

How can i display in loop (paged) the posts without the default featured image ? Here is my query of my custom taxonomy template page : <?php $term_region = get_term_by( ...
0
votes
1answer
63 views

Create custom post order (with custom post type meta)

I would like to display my custom post type by specific order. In my custom post type, i've 2 meta : - DAY ( Select : 1,2,3,4,5,etc...) - MONTH ( Select : Janvier, Fevrier, Mars, Avril, etc...) ...
0
votes
1answer
108 views

How get the 10 most viewed pages (not post)

I would like to know how it's possible to get the 10 most viewed pages ? I know how make it with post, but not with page... Thanks for your help.
0
votes
1answer
47 views

trying to write a variable into a wp_query, need help!

I am not a php coder, I am a designer and html and css guy. However, I am stuck at the moment trying to write a piece of code that will find the name of a post, then get and display all of the posts ...
0
votes
1answer
48 views

Advanced Taxonomy query, with 3 post types

I'm been trying to figure out how to do this for a few hours now and Have final given in to asking for help. I've got 3 custom post types that I need to query for a term called home which is inside a ...
0
votes
1answer
60 views

How to inject a post within a loop

I'm trying to inject a post while the loop is running. This post will be injected on a condition, so if(x == j){ //inject post here } I see this would seem easy to do, but i have a posts_per_page ...
0
votes
1answer
340 views

Video post format, extra content breaks video embed

I am using the content-video.php include to show the latest video post on my homepage. The include only shows the video from the post and not the rest of the content, which works well. My problem is, ...
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
177 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
89 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
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
165 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
84 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
211 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
61 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
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
1answer
75 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
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
126 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
93 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
56 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
102 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
54 views

Loop being strainge

So I hacked together a function that does the following: protected function _query_post($query){ $original = $this->_wp_query; $wp_query = new WP_Query($query); ...
0
votes
1answer
74 views

Pages with a loop (index, archive) are loading the first image as post_thumbnail

Using post thumbnails for custom header images -- works fine on straight pages. But custom templates that load a loop (including index) are pulling the first image instead of using the one set in the ...
0
votes
1answer
77 views

Using Query In Post Type Archives

I'm using the script below to call post from a certain category in the sidebar. It pulls from all post type on the homepage and on the single post page, but when it comes down to the post type archive ...
0
votes
1answer
669 views

Search.php - return number of results but cannot loop through

I have a following search.php page (this is just the code required for problem presentation). Why is my $total_results returning a number of posts found, but when I do a loop though it always print ...
0
votes
1answer
310 views

Loop and add Specific Categories and Products Images

Thanks to Rafael Marques I have a list of Products and Categories organized based on different created categories. I also have 5 different Custom Page Templates. Now I would like to display the ...
0
votes
1answer
188 views

Custom Post Type Loop breaking php

My While loop is breaking the rest of my PHP on the site. Below I put my code that is working but again breaking the rest of the site. Any Suggestions $query = array( 'post_type' => 'slides', ...
0
votes
1answer
155 views

How do i add custom post types to this query?

I'm using the code below to display the latest post from a certain category but i am using Custom Post Types and I don't know how to insert the custom post type function into this code. I want to ...
0
votes
1answer
159 views

Styling first post using Advanced Custom Fields

I'm working with a company's About page. I created a custom post type for "Employees", and am using the Advanced Custom Fields plugin to create simple meta boxes for name, title, image, and bio. The ...
0
votes
1answer
198 views

Post from one loop in different containers?

Is there a way to output posts from a single loop in multiple containers? Ideally I'd like to have the posts title/meta/content etc alternate between first-container and second-container, but I can't ...
0
votes
1answer
297 views

Display Page Meta Description on Child Theme’s Home Page

I’m working on a project. I need to display Custom Document Title & Page Meta Description in the home page. I mean you know that genesis has a custom Theme SEO Box under Post. I want that custom ...
0
votes
1answer
149 views

$query conflicting with other queries in the same page

This is my front page: <?php /** * Template Name: Front Page * * @package bbPress * @subpackage Theme */ get_header(); ?> <div id="primary"> <div id="content" ...
0
votes
1answer
125 views

Divide loop into several columns based on post custom field and enable infinite scrolling

How can I divide WP loop into several columns based on post custom field and enable invinite scrolling? Below is the desired output markup based on Twitter Bootstrap framework. <div ...
0
votes
1answer
54 views

One loop for sticky, one for all the rest - how, without specifying category?

I have styled an archive page to display one sticky post at the top with special design, and then to display all the rest of the posts in that category (except the sticky post) listed in standard ...
0
votes
1answer
105 views

Loop posts without any taxonomy

I've grouped my pages by some custom taxonomy. But I need to care about those without any taxonomy set. My code is: $page_groups = get_terms('page_group'); //get all existing page groups foreach ...
0
votes
1answer
399 views

WP_Query post at custom position

Lets say I have a custom query which based on two custom post types: $wp_query = new WP_Query(array( 'post_type' => array('post-type-1', 'post-type-2'), 'post_status' => ...
0
votes
1answer
112 views

Exclude Authors based off date of last post

I have several writers that range from frequent to one-time writers for my blog. On my Author page, I would like to separate out writers that have not posted an article in 6 months. It would be nice ...
0
votes
1answer
300 views

Display custom field outside the loop

Inside of my WordPress theme directory I have a standalone PHP file called image, this currently looks like this.... <?php define('WP_USE_THEMES', false); ...
0
votes
1answer
209 views

Using pagination with multiple loops causes it to break

I'm have two loops on my index page. One fetches the latest posts from the 'work' category and the other fetches the latest from the 'blog' category. (see below) I am also using a plugin called ...