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

loop on page makes shortcode fail

I have this typical WordPress page (page.php): <?php the_post(); ?> <div id="rightcol"> <div <?php post_class(); ?>> <?php the_content(); ?> </div> All works ...
1
vote
0answers
90 views

Shortcode in posts called by ajax is not working

I am using ajax to load content of post. Functions like the_title() works fine, but unfortunately the_content() doesn't returns any shordcodes( gallery nor tablepress ) data. here is my code: ...
0
votes
1answer
31 views

Change image size depending on page

I've got a simple photographic site and it uses large image sizes throughout. On the archive page, however, I've got about 35 posts each showing the first image of each. By default, the images being ...
0
votes
0answers
16 views

custom rearranged menu with excerpt for selected children in sidebar.php

I'm trying to make a custom index menu on the sidebar for an editorial multisite wordpress website. Suppose my pages are as follows: Level 1 Level 2 Level 3 Level 3 Level 2 ...
0
votes
1answer
53 views

How to append a query string to pagination?

I would like to append 2 variables from page 2 onwards in my loop. This is my normal category page www.example.com/category/news/ This is what I would like on pages: 2, 3, 4, 5 etc ...
0
votes
1answer
58 views

Wordpress Numeric Pagination with Query String [duplicate]

So I have a dynamic loop which is affected by a query sting in the URL.. For example I have 3 categories and when they click the category it just adds a query to the URL: <a ...
-1
votes
1answer
14 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 ...
0
votes
1answer
45 views

linking to post outside the loop

Is there an easy way to link to a specific page/post outside the loop? I used the get_permalink() code as follows. <a href="<?php echo get_permalink( 164 ); ?>/post-slug/"> </a> ...
0
votes
0answers
34 views

Password protected category based attachment/media list?

I am working on building a custom template, and I'm running into some trouble using the password protected feature for wordpress pages. Basically, the content from the page I have published and set ...
0
votes
0answers
62 views

multiple loops with pagination on the same page

I'm searching the web for this answer for three weeks now. Tried many things but nothing seems to work as how it should work. There must be a kind of trick what probably won't make sense to anybody ...
0
votes
2answers
65 views

Can't get the previous and next posts permalink

I tried to get the next and previous URL, and create a navigation. But it seems to only retrieve the permalink from the two first posts (but not the others recents posts). I have 5 posts (ID = 25, ...
1
vote
1answer
44 views

No content found on page 2 of pagination with 1 post per page

This loop (used on a taxonomy-term archive page) is not paginating correctly. The older/newer links for page 2 are there, but when I click on older, it returns "no content found" (when what I expected ...
0
votes
1answer
38 views

Php code error in wordpress if else statements [closed]

I have created an if statement inside the "else" of an if/else statement.However the code below the function does not run.When i remove the function the code below the function runs.Could you please ...
4
votes
1answer
91 views

Category as Class for Custom Post Type

I've only just realised that custom post types don't appear to output the category as a class in the loop, via post_class and I wonder if anyone can suggest a work around. Is this something that ...
0
votes
2answers
69 views

How can this multiple loop have pagination as described?

In the paste below is the code for the template running the CPT archive page at http://www.m.angiemeekerdesigns.com/totd Everything about the page is working as expected except the pagination. What ...
0
votes
1answer
21 views

Can't print out returned value

Function to return the meta value as per author. <?php function ac_author_score() { $userID = get_the_author_meta( 'ID' ); $query = array ( 'author' => $userID, ...
0
votes
1answer
29 views

Set loop format & have a loop inside other one

I have few questions on wordpress loop. The question may be strange, but it was fit for the jquery requirement. What I want to do are: Loop the "page" div with two "threads" show in each by NOT ...
2
votes
5answers
823 views

Get date of last update outside of loop

I'm trying to figure out how to display the date that a post was last updated outside of the loop. I'm able to display the published date using get_the_time() but there doesn't seem to be a "loopless" ...
1
vote
1answer
47 views

Query custom post type in the loop

I have a custom post type running called services: // Services function services_cpt() { $labels = array( 'name' => _x( 'Services', 'post type general name' ), ...
0
votes
1answer
117 views

Creating Multiple Loops in Genesis, One Post then 20, each with custom fields

I need to create a custom loop for a custom post type archive template, that is as similar to this page as possible (www.manta.com/totd) using the Genesis framework. Here is a paste of what I have, ...
4
votes
5answers
10k views

How to split a loop into multiple columns

If I have a loop running from a category query like : <?php $the_query = new WP_Query('cat=1&showposts=50&orderby=title&order=asc');?> <ul> <?php while ...
0
votes
1answer
59 views

Posts in loop all show the same author when there are many authors

I am iterating through an array of post IDs $ids. All is displayed correctly except for the authors. Every post shows the same author, although the posts are by different authors. I can't seem to get ...
0
votes
1answer
37 views

Display posts from multiple user roles

I have created a custom loop to show only admin posts, but now I would like it to display posts from both admins and contributors. Any help is GREATLY appreciated! Here is what I have so far: ...
0
votes
1answer
83 views

meta_query on a date range using an array of values

How can I do a query to return the post if the custom field array contains a date that is within the specified range? The query below is basically what I am after but it does not work... // the ...
0
votes
1answer
14 views

meta_query dates from an array

I have the below query which isn't returning anything. The query is meant to look for the date (2014-03-01) that is in the array, which it is. Any ideas? Or would I need to use a custom SQL query? ...
0
votes
1answer
26 views

Why in my theme I can't see all the statics content under the posts?

I am pretty new in PHP and I have the following problem, I am developing this WordPress problem: http://onofri.org/WP_BootStrap/ As you can see it is shown the unique post present on my blog (the one ...
1
vote
3answers
59 views

Some doubts about how to show posts in a custom theme?

I am pretty new in WordPress theme development and I have some doubt about this WP function used to show my post in the homepage: <?php if ( have_posts() ) : // Start the ...
0
votes
1answer
40 views

Need a conditional to test if title of parent page matches title of child page

In my main loop, I need to incorporate proper html markup into a conditional to test if title of parent page matches title of child page and do (or do not) display certain content. Default might be ...
0
votes
1answer
96 views

How to get the post excerpt using post object?

I'm trying to show post excerpt as in navigation. I'm trying this in plugin, does it make any sense? i don't know. I used $nex_obj = get_adjacent_post(false, '', true); for next post and it returns ...
0
votes
0answers
39 views

Use and get custom user metadata

I wanted to check if a post custom field matches the logged user's custom metadata. If it does then list only posts that match. I think that's possible.
0
votes
4answers
2k views

WP_Query and using a variable for 'cat'=> in the args array = WP Bug?

For the sake of this discussion, here's a version of my query within category.php: wp_reset_query(); $category_id = get_cat_ID(single_cat_title('', false)); $my_query = new WP_Query(array( ...
0
votes
0answers
20 views

Query Posts oder by Date

my query does not work as it should. This is my Code: wp_reset_query(); $paged = (get_query_var('paged')) ? get_query_var('paged') : 1; $args = array( 'post_type' => 'post', ...
0
votes
0answers
72 views

This webpage has a redirect loop issue with SSL page

I'm having an issue with the code below. As of right now, my domain is http://www.mydomain.com. When I try to click on the register link, I get an error saying: --This webpage has a redirect loop-- ...
2
votes
1answer
554 views

Generating dynamic Tabs with multiple query post loop

I am trying to generate a dynamic tab based navigating with query post my code is like this <div class="tabbable"> <ul class="nav nav-tabs"> <?php ...
0
votes
1answer
80 views

Loop through posts by each term and exclude duplicate posts assigned to several terms

Okay, i'll try to go a bit more into detail. What i did with this code is getting a list of artists ordered by alphabet. In this list i'm showing all corresponding news posts to this artists term. ...
1
vote
1answer
90 views

Alphabetical sorting of custom post type - one letter per page

Basically what I am looking for is a way to sort custom post type in alphabetical order and separate each letter, so you have one letter per page. See illustration. Hopefully there is a plugin or ...
1
vote
1answer
61 views

Wordpress Custom Query to show posts from last x years

I have found a way to show all posts from the current year with this code: <?php $today = getdate(); $lastyear = $today[ 'year' ]; $args = array( //'nopaging' => true, 'paged' => ...
0
votes
1answer
48 views

First post article different on Archives template

Hi I'm trying to make the first post article in the list different for the archive template. Basically they'd all be in order descending, but the first post in the list would be styled differently. ...
1
vote
1answer
76 views

How do I restart my loop with get_next_post()?

I'm looking for a succinct method of making get_next_post() double back to the beginning once it hits the last post. Currently, it stops once it hits the final post. Here are a few lines of code from ...
0
votes
1answer
38 views

posts_nav_link(); not showing up on static pages

I've got two different loops. The default on the homepage, but a secondary loop on the archive page. It grabs all the content, like so: <?php // WP_Query arguments $args = array ( ...
0
votes
0answers
26 views

How to setup the landing and entry pages for a custom post type

I have created a custom post type called services but am not sure if they way the setup pages is most optimal. For the landing page, I have created a normal 'static pages' called services and am ...
0
votes
1answer
49 views

Creating array to compare custom field values

I think I need some guidance here. I have a list of custom posts on a an archive template page that displays information from each of the custom posts. They are looped through using WPQuery: ...
0
votes
1answer
23 views

Combining external feed into post loop

I don't even know where to start on this. I would like to combine an external JSON or XML feed into the post loop and sort it by date. The page will need to auto-load the next posts and have the ...
0
votes
1answer
75 views

'Auto Draft' Post showing in wordpress loop

When running a wordpress loop, I am seeing these weird posts called auto draft. I have never seen this before. Does anyone know what they are and how to get rid of them? Any help is appreciated as ...
0
votes
2answers
250 views

Modify loop but keep the original query, what am I doing wrong?

I have a custom post type where I have a taxonomy cities and a term berlin. Archive can be seen at example.com/cities/berlin and it's rendered normally from the archive.php template. Now, I want to ...
1
vote
1answer
132 views

How to go about combining dropdowns / filter queries?

I'm coming up short with my googling here. (As 'filter' in wordpress always turns up more content related info). Anyway, my situation is this: I have Categories, Tags, Authors and Archive dropdowns ...
0
votes
1answer
80 views

Buddypress Group Activity Loop Filter activity type

I'm using Buddypress 1.8.1 When the group home page load I want to show only 'activity_update' and 'joined_group' activities in Activity Loop. Here is my Activity Loop code. It is standard loop ...
0
votes
1answer
61 views

ACF loop and php formatting

The following php will loop through each page and then output ALL of the ACF custom fields sequentially. What I need help formatting is a conditional statement that places all $fields, except ...
0
votes
0answers
43 views

need a wordpress loop to put in the sidebar

I need WordPress loop to do the following : check if there is no sidebar widgets active then get 5 recent posts with only titles and thumbnails But here is the thing : I don't want the loop to get ...
0
votes
0answers
61 views

Problem with the loop?

I'm customizing my Twenty Twelve theme to show a single posts from two separate categories on my home page using a custom template. Here's my code : <div> <?php $catquery = new ...