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)

1
vote
2answers
175 views

Single Page Wordpress Theme - Using page templates

Well I am lost, its late and I have been searching google all night. Heres the problem I am running into. I am trying to create a singe page website using wordpress "pages". How I have initially setup ...
4
votes
1answer
85 views

How to place a loop within another loop?

I have two loops setup using WP_Query: $latest and $popular that I'm working to setup in this example layout: Latest                        ...
1
vote
0answers
43 views

Multiple Loops Meta Data

I am now trying to figure out how to create the functions/ loops to pull my data from custom post types. I have two post types(keys): And I need to pull the data from both to run my functions. ...
3
votes
1answer
55 views

Query Custom Meta Value with Increment

I have a Query searching for a meta value I have added to my posts (meta-select). I have it feeding out in a loop with 4 results. Let's say I want this loop to start with the meta value "2" and work ...
0
votes
2answers
18 views

If Specific Post, Link Elsewhere

I would like to create a conditional statement that checks the loop for a specific post ID, then if true, it outputs a link elsewhere. This is what I have so far: <?php ...
0
votes
1answer
74 views

Problem with Front-Page.php loading recent posts

Hi I this weird problem where i have my custom front-page.php with set page (in Reading Settings) static page. What I want to have is a static page with welcoming message and later 1 recent posts ...
0
votes
1answer
32 views

I want my wordpress loop to only display posts of the standard format

I currently have the following php code for the content loop on my homepage. <?php if ( have_posts() ) : // Start the Loop. while ( have_posts() ) : the_post(); ...
0
votes
0answers
40 views

How do I get is_single() to return true when called internally from the_content()?

I have a custom page, e.g. blog.php?post=42 that shows a GET-specified post like so: <?php require('wordpress/wp-blog-header.php'); ?> <!-- my non-wordpress site's html goes here --> ...
6
votes
1answer
175 views

Inject post (from specific category) between posts in Loop

I would like to add a post (from specific category) between posts in the WordPress Loop (such as 'Sponsors'). Example: P P P S P P S P P S P P How can I achieve this? I am a beginner with coding, so ...
0
votes
1answer
107 views

Custom post type archive organized by category

I'm trying to display a custom post type archive page which displays all the articles of a a custom post type in columns. The columns organize them in their assigned category. On the main page, I do ...
1
vote
2answers
100 views

Ways to have multiple front-page.php templates that can be swapped out?

I essentially want to create several different front-page.php templates with different loops and layouts and then present an option in the admin panel to select one template on one day and a different ...
0
votes
1answer
71 views

foreach loop inside the loop creating duplicates in output

I have a foreach loop inside the loop that is getting info from a separate table. The table has a column that has an id that reflects the id of the post type so it should always be unique. When I ...
0
votes
2answers
46 views

Syntax error when I try to insert my loop into an unordered list? [closed]

I am very new in PHP and WordPress development and I have the following problem trying to insert some HTML code into the posts loop. I tried something like it: <?php if (have_posts()) : ...
0
votes
1answer
618 views

How do I get my loop.php to properly paginate?

I am using the Starkers theme as a foundation to build my theme and I am having difficulty getting my loop.php to paginate posts properly. When I click the "Next" or "Previous" post pagination button, ...
0
votes
1answer
22 views

Why isn't my multiple loops working?

I would like a multiple look to display the_content from the current page, & from another page. My multiple loo doesn't seem to be working. Can anyone advise, please? while( have_posts() ): ...
0
votes
0answers
45 views

How to show the posts list into a static page? Problems to use the loop into a static page

I have the following problem: I have to create a posts archive into a static page. So I have created this page template containing the loop to interate on my posts: <?php /** * Template Name: ...
1
vote
4answers
97 views

Create static front-page with 3-5 recent posts

I am struggling with front/landing page customization for my custom designed theme. I have designed custom theme and pretty much coded it using the Underscore boilerplate. As I understands, the ...
0
votes
1answer
30 views

Altering “posts_per_page” for defaut loop

I am trying to alter posts_per_page value in default wordpress loop on-the-fly, not for a custom loop. global $wp_query ; // $wp_query->query_vars['posts_per_page'] = 1000 ; ...
0
votes
1answer
753 views

A two column loop with one lead post

I got a loop from internet (I forgot the site) for two column post view. It has a nice CSS for it too. But skipping that for the question now. <?php $counter = 1; ?> <?php ...
0
votes
1answer
62 views

Have posts that belong to multiple categories, exclude some categories from homepage

So I have categories A, B, C and D. And also categories 1, 2, 3 and 4. I have posts that can belong to any four of these categories. But I want to exclude anything in categories B, 4 and D from the ...
0
votes
1answer
35 views

Category nicename inside loop in wordpress

How can I echo the current post's category nicename inside main loop. <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?> echo <div class="btn category-nicename"> ...
0
votes
2answers
134 views

How to get all unique categories for posts in loop?

I'm looking to get a plain list of the unique categories in a custom loop (only categories for the posts in the loop). I've been fumbling with some code for a bit and here's what I've got: <?php ...
0
votes
0answers
18 views

Multiple loop to display specific post at start of a list

I'm currently querying the following posts: <?php $args=(array( 'post_type'=>array( 'premium_content', 'post'), 'posts_per_page' => 3, 'orderby' => 'PREMIUM_CONTENT_FIRST!', ...
0
votes
2answers
102 views

Custom taxonomy template loop

I know that this question is asked numerous but i din't find an answer that suits to me. Well i'm made some custom post types and some custom taxonomies. I have the custom post type Products and ...
0
votes
0answers
16 views

How can I put a custom field value that needs to be inside the loop, in a custom menu via functions.php?

How can I put a custom field value that needs to be inside the loop, in a custom menu via functions.php?? I'm working on a bilingual website and I'm using the Bilingual Linker plugin. I was able to ...
0
votes
1answer
40 views

Some doubts about how the loop work (trying debugging it)

I am very new in WordPress development (and also in PHP development, I came from Java and C#). Today I have installed Aptana and configured XDebug to inspect what happens into the TwentyTwelve theme. ...
0
votes
0answers
27 views

Order by post_type within loop

Envision the following: <?php $args=(array( 'post_type'=>array( 'premium_content', 'post'), 'posts_per_page' => 3, 'orderby' => 'PREMIUM_CONTENT_FIRST!', 'meta_query' => array( ...
0
votes
1answer
28 views

Return only content in excerpt field in loop

I am sure this has been asked before, but I can't seem to find the answer, although it seems simple enough. I have built a custom theme based on another person's design. He uses both the excerpt and ...
0
votes
0answers
103 views

Displaying image from a repeatable group

I am having trouble displaying my image in a repeatable group. I am able to display all fields except the image. Here is the code to display a repeatable group $meta_boxes['project_metaboxpress'] ...
-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 ...
0
votes
0answers
32 views

Title outside of the loop in page template

I have a page template, with a very simple default query. The problem is that the title is outside of the loop, because of the layout. What do you think, is it problem? Or do you know an other way? ...
1
vote
1answer
42 views

Modify main loop in taxonomy archive page

Is there a way that I can modify the main loop in a single taxonomy template, but leave it untouched in every other template? In this case, I have a custom post type called "Events" which in turn has ...
0
votes
1answer
19 views

How can have a conditional template tag based on the main loop within a secondary loop with new WP_Query(), using get_template_part()

What is the best practice methodology for referencing the main loop from within the context of a secondary loop within a partial called via get_template_part()? For example, say my homepage contains ...
0
votes
2answers
202 views

Pagination/infinite scroll with WP_Query and multiple loops

I need that the main page of my site have 3 columns: - The first having the 5 most viewed posts; - The second with the next 5 most viewed posts; - The third with the most recent posts. I don't want ...
0
votes
0answers
42 views

Newer/older posts links don't show up

I am working in a twentyten childtheme and the the newer/older links don't show up on my index page, under the listing of ten blog posts. What bothers me is that even when I add a <!--comment--> ...
0
votes
0answers
99 views

Geo My WP automatically list posts based on visitor's location

Is it possible to affect the WP loop to automatically only list posts based on the visitor's location with the Geo My WP plugin? I'm creating a news site that will serve several towns and I'd like to ...
1
vote
0answers
66 views

Divide Loop Into Days & Categories

If you could help, I'd greatly appreciate it, because I'm halfway there, but I'm currently stuck! The site I'm working on needs to have it's posts, within the loop, divided up by days, and then under ...
-1
votes
3answers
61 views

Tags outside the loop

I want to display the tags of the posts in my main page. I used: global $post; the_tags(); But it's only showing up for my FIRST page.
1
vote
2answers
9k views

How to get posts published between a date and today?

Is it a way to get posts published between a date and today with query_posts() ? Example : All posts published since 2012-04-01 Thanks EDIT : How to add the filter date on this Query Posts ? ...
0
votes
1answer
30 views

Making a specific page wordpress compatable that is not index

When I first created my website I overwrote the wordpress php and essentially made the website static. Now I want to make one specific page wordpress compatable (e.g. when i make posts from the ...
0
votes
1answer
198 views

using update_user_meta to rank users

I'm using a plugin that allows users to vote on posts, I'd like to add each vote that's cast to the authors user_meta so I can rank users the same way I rank posts. There's a couple of different ...
0
votes
2answers
136 views

How to show only the date, the title and a little “summary” of my WordPress post in my custom theme?

I am pretty new in WordPress theme development and I have the following doubt about how show posts into a page. I have this page belonging to an old custom legacy blog that I am build again using ...
3
votes
3answers
218 views

Display posts the match taxonomy term linked from wp_list_categoies?

This should be simple, but it escapes me. I have a custom post type and a custom taxonomy. The taxonomy is named "asset_type" and the slug is "type" I am using wp_list_categories to provide a ...
0
votes
1answer
32 views

What file have I to create in my custom WordPress theme to show all the post belonging to a specific category?

I am pretty new in WordPress theme development and I have the following doubt. I am working on this custom theme: http://lnx.asper-eritrea.com/ Into this website upper horizontal main menu I have a ...
0
votes
1answer
50 views

Three Column Loop

I have a theme that creates two columns of categories with child posts from that category. I've tried messing with the code that inserts the after two posts are listed, but it's not working (because ...
0
votes
1answer
58 views

Display page of custom posts?

I have a custom post type, "design_asset". I am displaying them on a page template, with the loop <?php rewind_posts(); $paged = ( get_query_var( 'paged' ) ) ? get_query_var('paged') : 1; $args = ...
0
votes
0answers
44 views

3 Column Loop with Pagination

I tried to run a loop and split post in 3 columns and then added pagination using Wp PageNavi wordpress plugin. It was working fine from where i copied this code but it seems to be not working for me. ...
0
votes
3answers
614 views

Remove comma from last item output from loop

(or add comma to all items but the last one...) Most of the information I have found relates to using a counter within a foreach loop. In this particular situation I am using Advanced Custom Fields ...
0
votes
1answer
71 views

Change position of entry title

I've been unable to move the post entry title to under the post's image. Whenever I do this, the title moves under the content and appears just above the footer. loop-single.php - <?php if ( ...
0
votes
1answer
133 views

Keep post format class with isotope filter

When I add isotope filtering for displaying posts, I lose the format class. WITHOUT isotope filtering: <article id="post-22" class="post-22 post type-post status-publish format-image hentry ...