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)

3
votes
1answer
497 views

Creating nested forum loops in bbPress

I'm creating a customised forums front page for bbPress, by listing forums in a different way to the bbPress default. Essentially what I'm trying to do is replace the use of bbp_list_forums() with a ...
2
votes
1answer
103 views

Impossible to get Attachments Outside Wordpress?

My page (outside the wordpress install) begins something like this: global $wpdb, $wp_query; define('WP_USE_THEMES', false); include_once 'word/wp-blog-header.php'; $args = array( ...
2
votes
1answer
709 views

get_template_part from plugin

This is default get_template_part function inside WordPress: function get_template_part( $slug, $name = null ) { do_action( "get_template_part_{$slug}", $slug, $name ); $templates = array(); ...
1
vote
1answer
14 views

How to display posts by vote count and if no value continue with latest posts with no votes?

Maybe someone can help me with this. I want to display posts by votes. Users can only vote up. So what I want is - the most voted posts by vote count on top and then latest posts with no votes. The ...
1
vote
1answer
28 views

How To Get Posts With A Specific Word

How to retrieve posts with a specific word in the loop. For example, I want to retrieve all posts with the title of the profile post (custom post type): ...
1
vote
1answer
209 views

Enable infinite scroll on single.php

I have a problem similar to the author of this thread: Possible to paginate on single.php? I am trying to enable infinite scrolling on single.php. So far I successfully load an additional 1 post when ...
1
vote
1answer
1k views

ajax for filtering posts by category in wordpress loops

I've been looking around for a way to filter my posts on http://www.waziproject.com/wazimagazine/ without reloading the page. So my question is if anyone can help me out to turn the following into a ...
1
vote
1answer
63 views

How to list posts with disabled/closed comments, with pagination?

i'm interested how to display all posts (from all categories) that have closed/disabled comments? I have tried using the comments_open() function inside the loop, that works, i don't know how to ...
0
votes
1answer
9 views

How to show Y number of custom posts after every X normal posts?

I have a loop within a loop. I figured out how to show all or X number of custom posts after Y number of normal posts. I also figured out how to show 1 custom post after every Y normal posts. How do I ...
0
votes
1answer
45 views

Query Number of Loaded Posts in Loop

I'm loading posts via a query of a custom taxonomy called 'band': $args = array( 'tax_query' => array( array( 'taxonomy' => 'band', 'field' => 'slug', 'terms' ...
0
votes
1answer
28 views

Genesis multiple category custom loop 404s after first page

Ok so, I have a page which shows a feed of posts in the "news" category (url is: mydomain.com/category/news ), but the client wants it to also show posts in the "press-releases" category. So in the ...
0
votes
1answer
42 views

Next / previous posts link doesn't show up with Posts 2 Posts

I am working on a Wordpress project where I use the Posts 2 Posts plugin to show posts from one post type to posts from another post type. This works great but for some reason my next_posts_link() ...
0
votes
1answer
30 views

Insert/sticky multiple posts in multiple positions

I'm attempting to do this but with multiple posts and specific positions. The post positions are hard coded right now, but will be pulled in from post meta. This code is only being ran on the homepage ...
0
votes
1answer
45 views

Show multiple categories in query using redux framework variable

Stuck on trying call an option variable using the Redux Framework - that is utilizing multi-category select - inside the query. Here's what I have as my query: $the_query = new WP_Query(array( ...
0
votes
1answer
49 views

How to loop custom post type posts by author?

Maybe I'm not doing things the proper way, but it seems to be working very well. Also, this question title is so confusing. I don't know how to ask the question. Perhaps someone can help edit? Thanks. ...
0
votes
1answer
20 views

Remember the meta value with radio buttons

I've created a simple meta box consisting of two radio buttons: yes or no. When they click on the appropriate box, it saves the meta value to the database. However, the post page does not remember it ...
0
votes
0answers
57 views

Changes in a home, two columns

I'm working with this template (this is a demo), I need the post shown on the home to appear in two columns rather smaller in width. Enclosed is my index.php code, I've tried everything by various ...
0
votes
0answers
50 views

How to loop two arrays from custom post types

Not sure if I'm going about this the right way but I've been stuck on this for a couple of days and it's killing me. Got a custom post type called 'featured-work' and custom fields in it. These two ...
0
votes
0answers
259 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
0answers
30 views

Group category list by other categories excluding some posts

I want to list posts on a category page in a special way. All my posts belong to two categories out of five. The categories are of two "types", the 'w' and the 'k', and a post cannot belong to more ...
0
votes
0answers
20 views

Wordpress Group By Problem

i have a custom post type called "events". in this post type, i have a metabox with the date of the event. saved as timestamp. my problem is, i want a whole year with every month. current only the ...
0
votes
0answers
35 views

Insert a slider with selectors to see different galleries

I am almost a newbie, and maybe my quiestion is very simple for anyone else, but for me it turns out to be impossible to solve. The website I am developing has a custom page with information about a ...
0
votes
0answers
288 views

The Loop won't display page or post content

I can't get the page content to appear in my custom wordpress theme. I have an extremely simple version of The Loop, which should just display the title and the content of the current page or posts. ...
0
votes
0answers
81 views

nesting a loop with sticky posts?

I am trying to retrieve two types of posts composing a total of 5 posts on the first page of a site the first post is styled differently to the following 4 posts (to maintain a sense of clarity let's ...
0
votes
0answers
25 views

Wordpress custom taxonomy bullet list

I'm trying to break down the custom taxonomies into a list to filter posts. such as Front small medium large Middle small medium large Back small medium large no I can list each terms ok, ...
0
votes
0answers
44 views

Simple loop with shortcode rendering problem

The following loop is in a single.php template file. It works ok, but the shortcodes aren't rendered. the loop: <div id="circula-destaque"> <?php if(have_posts()): while(have_posts()): ...
0
votes
0answers
29 views

How to combine Custom Post Type Pagination with $selected_id?

I have a Videos CPT, everything is set up nicely, but I wanted to add pagination. Loop begins here// $args = array( 'post_type' => 'videos', 'posts_per_page' => 10 ...
0
votes
0answers
72 views

Show posts using custom while loop with pagination

I have an array of post ids i would like to show in a page 16 at a time. The array may include some repeating ids that is why i could not use post__in in a custom wordpress query because some of the ...
0
votes
0answers
188 views

How does the JSON API work to parse incoming JSON and fetch a post based on an ID?

So I have to interact with a large, seperate system on another server that is going to return, at the very least, post ids to my wordpress install in json format. And before others might ask why I'm ...
0
votes
0answers
39 views

Detecting top parent category fails on home page

I have the following method to detect a top level category. But it fails on home page returning alway true. //detect parent category function in_parent_category($cats,$_post=null){ foreach ...
0
votes
0answers
141 views

Add Div IDs dynamically to CSS

I am trying my best to convert this amazing design in a wordpress plugin, but since I am not a developer and a noob, I can't get my head around it. Background image can be added in the post loop with ...
0
votes
0answers
56 views

Wordpress show posts from children terms of a taxonomy term

I was a little hard for me to explain what I'm trying to achieve in the title so I will explain my setup much more detailed here. I tried to find an answer searching here and other sites but couldn't ...
0
votes
0answers
33 views

Prevent posts fetched with “The Loop” code from terminating in a line of dashes

I pulled recent posts onto my website using a fetch X posts loop with some PHP for WP's "The Loop". At the end, it also returns a line of dashes as a sort of end of document delineator. Is there a ...
0
votes
0answers
65 views

Combine Query and Select Database to create directory loop

I have a query loop on my page that I am using which displays all users on the page with certain custom fields filled out. It's working fine however, I need to also query these users for their level ...
0
votes
0answers
98 views

Marginal pagination on home.php

I'm trying too make a custom wp-theme and use a few loops in home.php. But now I can't finish home.php because of pagination. How cant I realize any type of pagination with saving that kind of ...
0
votes
0answers
46 views

I have a complicated loop query, that I want to output into grids

The code below loops taxonomies, then loops posts within each taxonomy. I would like each taxonomy group put into a CSS grid column. How do I get this into grid rows correctly? <?php ...
0
votes
0answers
46 views

Run a query when in last category

Can anyone help? ive searched google but with no luck. currently Accounts has sub categories but no posts /accounts/ = /billing1/ + /finance/ Billing and finance have posts but don't want ...
0
votes
0answers
87 views

Get posts by subcategory 'name' not the slug?

For each category I have 2 sub categories with same name. For example, Category1 has two subcategories: Sub1, Sub2. On the category archive page, I want to display the posts from Sub1 and Sub2. So ...
0
votes
0answers
33 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
0answers
134 views

How to exclude child terms from tax query foreach loop

I have this query which is working fine but I can not get it to exclude child terms and include only parent terms. This is what I have so far -- <?php $custom_terms = get_terms('videoscategory'); ...
0
votes
0answers
125 views

Limit categories appearing in latest feed

I am using ColorLabsProject's 'Reportage' theme ( http://demo.colorlabsproject.com/reportage/ ) as a mobile site and the six categories listed at the bottom of the front page are pulled in ...
0
votes
0answers
276 views

Dynamic Dropdown populated with Categories from current page?

I have a page where it lists the category name with it's posts under. On this page it only lists the posts that are also in another custom taxonomy. To do so I am using this code which works fine -- ...
0
votes
0answers
130 views

Avoid duplicate posts from sidebar widget on homepage?

In a normal dynamic sidebar of a theme's homepage template the sidebar widgets display lots of duplicate posts on the front page. It shows "recent posts" and posts from certain categories in main ...
0
votes
0answers
62 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
82 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
93 views

Posts 2 Posts, losing connection in template parts

I am using the Post 2 Posts plugin to connect different post types. My code works perfectly when it's all in one file (archive.php). The problem I have is taht I want to split out the part that does ...
0
votes
0answers
249 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
0answers
148 views

Multiple Wp-Query Loops inside index.php

The site url is: http://aachurch.org/reborn I'm trying to achieve multiple wp-query loops inside my index.php, showing different categories of posts. The first loop works but nothing shows up for the ...
0
votes
0answers
549 views

How do I paginate a get_posts() request inside another page loop (Paginating childpages)

The heading says a lot, so I'll repeat it here "How do I paginate a get_posts() request inside another page loop?" I'm using a page to display child-pages and I need to paginate them. Edit: Should I ...
-1
votes
0answers
35 views

How To Display Categories Conditionally on “The Loop”

I'm trying to get specific categories to display, and only when a given page is displayed. I have tweaked the start of "The Loop" to look as shown below but it doesn't work. Any suggestions on how to ...