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

Recent posts headlines. How to optimize the loop

I'm using this in my page template to display the 20 recent posts headlines from category number 8, 17, 23, 423 <div id="horizontalTab"> <ul class="resp-tabs-list"> ...
0
votes
1answer
216 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 ...
1
vote
1answer
32 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 ...
1
vote
1answer
38 views

Custom Post Types strange pagination problem

Have a strange problem with pagination, the query work fine when I'm in homepage, but if click for the next page I get a 404 error. Disabling permalinks settings, I saw that in the query string (when ...
0
votes
1answer
61 views
+50

Custom Search Not Consistent with Results

I've set up a custom search to use the s GET variable on a URL. I want it to fetch certain results but I've come across an odd problem. First, here's my code: $search_term = $_GET['s']; ...
0
votes
3answers
85 views
+50

Pagination on Single Post

I'm looking to set up pagination on my single.php file so I can have my infinite scroll function correctly. I know that pagination can be put on a single post but I somehow need to make the single.php ...
0
votes
0answers
29 views

Get child taxonomies in loop

Here is the structure of taxonomies what I want to display: Here is my HTML code loop: <li> <a>TAXONMOY 1</a> <div class="dropdownContainer"> <div ...
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 ...
1
vote
2answers
77 views

Load wordpress content in other domain

I've made some researches on google but can't get the right answer. I need to get my wordpress loops outside a domain using php file. For example: I have a website hosted with www.mysite.com using ...
1
vote
4answers
2k views

Order posts by custom field and if custom field is empty return remaining posts

I have an archive page ordered by a numeric value in a custom field. This returns the ordered posts correctly, but does not display posts that don't have a custom field. $paged = ...
0
votes
1answer
20 views

display post tags on single.php inside loop

I want to display the tags of the current post in the single.php and do the following: <?php if (have_posts()) : while (have_posts()) : the_post(); ?> <h1 class="single_h"><?php ...
0
votes
0answers
8 views

Start WP Pagination From Number 1 in URL

I am using this code to paginate gallery post type images: $images = get_posts(array( 'post_type' => 'attachment', 'post_status' => 'inherit', 'post__in' => $image_ids, 'orderby' => ...
1
vote
2answers
546 views

Specific Loop For 2 <div> Within Each <li>

I need to create a loop that can logically be described as the following for a carousel: Requirements: 3 Loops 2 Posts Per Loop No Duplicates Order by Post Date Visual: < Start Loop #1 > ...
0
votes
3answers
98 views

Is_single() conditional tag returns null in query

Trying to figure out why this won't work for me. I'm simply trying to run a loop of all posts and pages, and tag them as post and page in a array. But the is_single() conditional is not working, all ...
0
votes
0answers
24 views

Same date post in one box

I would like to ask for a little help. I wish you the same date is a Post;, you just enter the time of the WP. The twist, however, is that it is all in a box. I'll show it to be understood: ...
0
votes
0answers
26 views

The Loop: Not Repeating Styles [on hold]

For some strange reason, my loop is not repeating my mark-up/styles consistently. My code is as follows: <script type="text/javascript"> //<![CDATA[ (function($){ //This functions first ...
0
votes
2answers
27 views

Get Value of Post before

I have a normal loop in wordpress and in every post i need to check the value of the post before to compare it with the current post. -- POST 1 -- ** DO NOTHING ** -- POST 2 -- ** GET VALUE FROM ...
1
vote
1answer
212 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 ...
0
votes
0answers
28 views

One page loop issue with posts

I have been working on this loop for a very long time. I think so far this is my best version as it will get page templates. My problem is that it does not get posts and I am not sure why. When I try ...
0
votes
1answer
34 views

Hook into the loop via a plugin, and output something after every X post?

I have a plugin where I want to output ads after X number of posts on the home page. The home page is step 1, but things like archives should be possible too once I get the code for the home page. ...
0
votes
1answer
21 views

Display specific posts on home page

Can someone please help me figure out if the "List category posts" plugin is the easiest solution to my problem: My goal is to be able to choose which posts are displayed on our homepage under ...
0
votes
1answer
14 views

loop not showing up when using a custom page template

Okay So I want to create a Custom Page Template that displays my posts exactly the same as my index.php does. You can see the code of my index.php at the bottom. So I create a .php file named ...
0
votes
1answer
553 views

Loop through Custom Post Type, and then show children within each iteration

I am currently using WP_Query to loop through a custom post type, and only showing the parent posts like so: <?php $loop = new WP_Query( array( 'post_type' => 'programs', ...
0
votes
0answers
18 views

Only show top level posts of specific category

I've been trying to create a loop that will only show the top level posts no children/sub category posts. Basically what my categories look like are -- -All --one --- A --- B -- ...
0
votes
0answers
12 views

Filter terms bases on multiple taxonomies - operator not in? [duplicate]

Building a function for filtered taxonomies. How to use 'operator' => 'NOT IN' or 'operator' => 'IN' inside the query to only show tax_query terms that are connected to all taxonomies instead of ...
0
votes
1answer
30 views

relation OR instead of AND - Filtered term ID's in loop

Question not related anymore.. First I tought about the relation OR/ AND for results, but I believe I should work with 'operator' => 'NOT IN'. I would like to query the results that meet multiple ...
5
votes
1answer
5k views

How set featured posts using checkbox in post edit screen?

I want to make selecting a featured post is just by checking a checkbox in edit screen AND be able to retrieve these featured articles from only specific category ? in short what I'm looking for : ...
1
vote
1answer
10 views

Obtain page data and use regular loop

Is there a way to obtain the data from a certain page outside the regular flow, more efficiently than via get_post($id)? I know that I can get for example the title with $post = get_post($id); $title ...
0
votes
1answer
256 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, ...
1
vote
6answers
6k views

How to get Author ID outside the loop

I can't get the post author ID outside the loop to make the get_the_author_meta work. So far I've tried different approaches: 1. $author_id=$post->post_author; 2. global $post; ...
6
votes
3answers
91 views

Can I force WP_Query to return no results?

I'm working on a website with a search feature that allows users to search through a lot of post meta. There is a specific search pattern that I would like to forcibly return no results for. The ...
1
vote
2answers
510 views

Loop with slider (slider not loading)

In my slider.php I have a loop that calls for a custom post type. That custom post type has a meta box for a slide url (link/title/etc). I can see the loop and everything else is working because in ...
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 ...
0
votes
2answers
48 views

Why does `inclusive` not work in this wordpress loop?

It's seemingly simple, I have this loop which should loads posts from, and including the current post. <?php $categories = get_the_category(); foreach( $categories as $category ) { $catID[] = ...
1
vote
0answers
22 views

How can I load posts starting from, and including, the current post?

I'm loading some posts using this argument: $args = array( 'category__in' => $catID, 'category__not_in' => 1, 'posts_per_page'=>10, 'date_query' => array( array( 'before' => ...
1
vote
3answers
2k views

Recent posts on a static home page

I want a static home page on my wordpress website, I have already set this up and have a bit of content on it, the next step is I want to have 5 recent posts underneath the content. As a normal page ...
1
vote
2answers
330 views

Split Content and Gallery

Is there a way to split up the post content and the gallery short code. I want to display the gallery outside my normal content no matter how or where it is placed. I can use this to get the shortcode ...
0
votes
1answer
260 views

How do we create a custom taxonomy template that loops through child categories in term order?

We're building a site that sells Biking Gear : http://www.nimblewearusa.com.php53-16.dfw1-2.websitetestlink.com/ We're using the Genesis Theme Framework, and developing a custom child theme. It has ...
1
vote
1answer
17 views

How do I display the posts from a custom post type on a category.php page?

I have set up a category.php according to this wordpress hierarchy diagram. When I am on the page http://example.com/category/my-category I want to display all posts that are under my-category using ...
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
36 views

Dynamic Stylesheet loads but doesn't finish

I am creating a website for an architect with large images being a main feature of the site. Given the potential size of the images I wanted to have a way to create responsive image sizing (and of ...
0
votes
1answer
236 views

How to Loop and add Specific Categories and Products Images into Specific Page Template?

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
226 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
38 views

Get first post from wp_query

How can I get the first post from a WP_Query result? $connected = new WP_Query( array( // Arguments )); // This doesn't work.. echo $connected[0]->post_name;
0
votes
0answers
33 views

Random posts loop order [duplicate]

I have used a loop for my theme homepage, but when I go to page 2 or 3, 4, etc., I get the same random posts in all pages. I want to make the loop generate different random posts each page. <?php ...
0
votes
2answers
42 views

Adding pagination to WP_Query [duplicate]

I've got the following loop (this is on a single page, not the index.php): $top_meta_cat_args = array( 'posts_per_page' => 9, 'post_type' => 'post', 'meta_key' => ...
0
votes
2answers
312 views

How to show custom post type on homepage and in catergories

Details Wordpress Version: 3.4 Theme Deadline Version 1.2 Site URL: littlenomads Plugin being used to create the Custom Posts Types 1.Types Plugin – Custom Post Types, Taxonomies and Custom Fields ...
0
votes
0answers
33 views

How to display all posts on one page and then open them inside a modal window

I'm working with the WordPress Bootstrap theme. I want to show all the post listing with their featured image on my page and after clicking that image I want to open the post description into a modal ...
0
votes
1answer
13 views

Custom content before post content

I am using this code to insert custom content after title and before content. How can i limit it to only "post" not pages and custom post types. function theme_slug_filter_the_content( $content ) { ...
0
votes
2answers
346 views

WP Query - duplicated posts once including tags in search results

I running WordPress on IIS & SQL server. As some of the plugins do not work correctly with DB ABSTRACTION I am using a lot of functions.php filters as so on. To make my search results include ...