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
57 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
103 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
78 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
688 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
331 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
194 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
158 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
161 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
215 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
311 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
154 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
126 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
117 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
422 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
114 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
312 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
216 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 ...
0
votes
1answer
513 views

Exclude post formats in custom loop

I'm trying to exclude all post formats but standard from a page template loop that displays 4 latest posts. For some reason I can't get the query to work. This is my page template global $paged, ...
0
votes
1answer
255 views

Converting multiple loops into one single loop with pagination

I am using Isotope jquery plugin to filter/sort posts in Wordpress but to correctly filter the posts into the right order I have needed to output each category one after the other. To do this I've ...
0
votes
1answer
271 views

wpdb inside foreach loop only returns first result - 2 other similar cases found

@Milo Problem solved, found spaces in the array $arrname. I was trying to get post id using post_name. First of all I stored all post_name in an array an then loop through the array to use the key ...
0
votes
1answer
138 views

Displaying posts on Homepage

I am wondering how to add a column to my homepage that shows the five most recent posts from the blog page located under the "Latest News" heading. Here is the link to my development site. ...
0
votes
1answer
47 views

Tables not showing divs and loop/php items

I know this is an absurd questions, as who uses tables anymore? I got handed this and just need to make it work really. I don't know anything about tables so it's been a learning experience. I ...
0
votes
1answer
213 views

How do I filter a custom post type loop by a field?

OK, very simple task, I'm just not good at PHP. I have a page where I want to list some staff using a styled list. Here is the page all working fine, I just need to divide the results - ...
0
votes
1answer
114 views

Change loop to display items in order

I am trying to customise a search query so that items returned are ordered in descending order. I have managed to find the loop that generates the results.... global $wp_query; $args = array( ...
0
votes
1answer
59 views

Load featured article once in a loop

I'm working on a WP-Touch theme and I have a template file that looks like this: <?php get_header(); ?> <?php locate_template( 'featured-post.php', true, false ); ?> <?php ...
0
votes
1answer
96 views

Filtering posts by WORD in custom field

I need to filter my posts in categories pages, by showing only posts that have specific WORD in custom field value. I need php code that i should add in loop for this category. Details: I need loop ...
0
votes
1answer
130 views

Showposts doesn't show the number of posts indicated

on my homepage, I'm using several loops to display posts from different categories in various sections of the page. The code I'm adding before the loop is : <?php ...
0
votes
1answer
156 views

Home page loop with pagination problem

I used a loop to display posts from specific categories, then add the code for WP_Paginate plugin under that loop ... below my posts I see pagination links from 1 --> 5 , however when I press page 2 ...
0
votes
1answer
164 views

Sort by category and then date?

I'll try to be as clear as possible. My Wordpress site has multiple custom categories and posts types all which need to be displayed on the home page blogroll. But I need the first post on the ...
0
votes
1answer
660 views

Listing Specific Categories from Current Post with Depth

I've been on this for sometime and been having a ton of issues to find a proper way to do what I'm trying to achieve. An Example would be as follows: I have a featured Image with a rollover and I ...
0
votes
1answer
142 views

How to looping taxonomy terms?

is there any way to loop terms in a way they display in menu? Eg: Let say I have 2 taxonomies in a post type - tax1 and tax2. They are not hierarchical to each other. If I have posts that have ...
0
votes
1answer
58 views

Only show posts with image and the correct ammount of posts in loop

This script makes a loop showing only posts with images, but I have a problem. It doesnt show the right ammount of posts pr page. Probably because it counts the total nr of posts, including the ones ...
0
votes
1answer
70 views

The loop: more posts than I want to fit on one page

I am working on using the wordpress loop to call posts from my wordpress blog into my website. I have my loop set up to grab the 10 most recent posts under the portfolio category and display them on ...
-1
votes
1answer
967 views

How to Display Post View Count

I am trying to display post view counts. I've tried below function to display the post view count, but I'm getting same post view for all the post in loop. Not getting correct post view count. ...
-1
votes
1answer
56 views

Showing ads after posts in home page

I am using this code for showing ads after one post in the home page. It's working fine. But I want to show an ad after one post and another one ads after 5 post. What will the loop be. Any ...
-1
votes
1answer
287 views

Excerpt all post content Content Same Size without word cutting off

On my category page there are list of 24 posts with title and excerpt content. To display specific lengths of content, I am using substr function. Now the issue is that each post excerpt content are ...
-1
votes
1answer
37 views

Duplicate post problem

I have two loops. One that shows only one post, the other shows four. however i'm getting duplicate posts. Loop one <?php $my_query = new WP_Query('showposts=1'); while ...
-1
votes
1answer
26 views

repeating posts on 2nd page to posts

I am having an issue where I wanted to strip out all categories but one from the homepage so I added the following to the loop: query_posts('cat=2'); However now the issue is that page one of the ...
-1
votes
1answer
39 views

Limitless amount of posts in custom archive page

I want to get rid of pagination completely on my custom archive, I want everything on 1 page. How can I do this? Currently I'm getting my posts with: <?php query_posts($query_string . ...
-1
votes
1answer
300 views

How to toggle a div element between two images when click two submit buttons in a wordpress loop?

How to toggle a div element between two images in a wordpress loop when click two submit buttons simultaneously? I have one div, 1st image should select when i click on the first submit button and ...
-1
votes
1answer
55 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 ...
-1
votes
1answer
96 views

Custom field not showing

I am trying to get 3 images and their links which I have defined as custom fields. The custom field aren't displayed and when I var_dump() my get_post_meta() it returns string(0)"", what am i doing ...
-1
votes
1answer
57 views

Same posts within a paginated page

I have a specific template that displays only posts from a category (350). When I paginate my posts, the posts stay the same. Below is some code that makes up this template. Any ideas how to correct ...
-1
votes
1answer
167 views

Multiple loop with pagination in same page

In my home page i have two <section> in which i perform two different loops on different post categories. Here the code: <section> <ul class="loop-article"> ...
-1
votes
1answer
903 views

Adding vkontakte social “like” button to posts results in multiple buttons on first post only

I'm trying to add a VKontakte (pretty much the russian version of Facebook) "like" button to wordpress posts by placing it within the loop along with Twitter/Facebook "like/share" buttons. While this ...
-1
votes
1answer
244 views

Limit wordpress posts loop to continue onto another page

Theres a site i did that on the home page, i created kind of like a news box type of thing which is what the client wanted... the posts bit im using to limit the posts on the index page is ...
-2
votes
1answer
151 views

displaying recent comments outside loop without plugin

So I wanted to display the 10 most recent comments from my blog onto my homepage. Can anyone tell me how to do that? preferably without using a plugin if possible... thank you.