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
0answers
9 views

Stuck in a Redirect Loop

My Wordpress site is stuck in a redirect loop and I can't now access it. I recently purchased an SSL certificate which my site host says is installed correctly and points to the correct place. I ...
0
votes
1answer
13 views

CPT while loop not working

I am having problems getting anything out of this while loop: <ul> <?php $query_args = array( 'post_type' => 'Smart panels', 'posts_per_page' => 5, ...
0
votes
0answers
13 views

Why I obtain this WP_Query strange behavior trying to select posts having a specific tag?

I have the following problem with featured tag posts I have a page of a website in wich I want to show only the posts that have setted a specific tag (using the loop). So in this page I have put ...
0
votes
0answers
11 views

Search results problems

I'm having an hard time with the Search results page in my theme. I am using Magic Field for my creation of custom post type. All my custom post type are set to "post", but I can't get how the search ...
0
votes
1answer
33 views

Limit article to 100 characters. Can't use the_excerpt…

I've been struggling with this for a long time... I want to limit article lenght to 100 characters and after 100 char. limit, add at the end '...' linked to a single post (like wordpress's ...
0
votes
1answer
15 views

How to exclude the last post from a category(featured for example) from the main loop?

I am using 2 loops on the main page, one that shows the last post from the featured category and a general one with all the posts. The problem is that i get the last post in the featured category in ...
0
votes
0answers
19 views

Creating two loops. First for latest post or latest sticky, second for all other posts

I'm new to Wordpress and PHP and I've been battling with this for a while now. What I have for the moment is 2 loops. I want to first loop to only ever show 1 post: either a sticky post, or the ...
0
votes
0answers
23 views

Woocommerce custom product loop not display all product on the homepage [on hold]

This is the code I use to display the products on the home page. <ul class="products"> <?php $arg1 = array( 'post_type' => 'product', 'posts_per_page' => 8 ); ...
0
votes
1answer
26 views

Move posts to top of WP_Query if in certain Taxonomy?

I'm trying to figure out the best way to promote certain (custom) posts to the top of my Wordpress loop. I can't use sticky posts because they are all in a custom post type.. I was thinking of using a ...
0
votes
0answers
38 views

Why doesn't my WordPress page show the most recent post?

I was wondering if someone could help me with the following. My news page on my WordPress website doesn't show the most recent blog post, which I want it to do. The code I have is: ...
0
votes
1answer
21 views

Next 10 posts data of currently viewing post in blog page

I am developing a theme and using WP_Query to fetch the content from the database, but now i wanted to implement a loop using a WP_query that will show me the next 10 posts with title links and ...
0
votes
1answer
21 views

Where is the WP_Query instance instantiated (when working with themes)?

This may be a very basic question, but I could not find the answer. The following documentation http://codex.wordpress.org/Class_Reference/WP_Query shows the code // The Query $the_query = new ...
0
votes
0answers
21 views

Custom post-type, multiple loops not displaying on page?

I have an issue with a loop within my page not displaying. The first loop I created (OUR SPONSORS) is displaying fine but the second (OUR PARTNERS) loop isn't displaying (confused!) Below is the site ...
0
votes
1answer
24 views

Adding custom post type to loop

Hope someone can help me with this. I have a custom post type ('article') in my WordPress installation, and I'd like to display those posts alongside the default posts in the regular post feed. This ...
0
votes
1answer
31 views

Unable to display paging navigation with a custom post type loop

I have used a starter pack for my WordPress theme development, but I can't display the navigation on a custom post type loop. The framework starter is : http://underscores.me/ There is my PHP Code ...
-1
votes
2answers
24 views

Single loop with dual content area

Is there a way to implement a single loop with dual content area. E.g. A single loop having 2 of <?php the_content(); ?> Dinstinguished as shown bellow with video and write-up respectively ...
0
votes
2answers
36 views

Multiple instances of Featured Image Thumbnail As A Background On Homepage

Here's what I'm trying to do: Make it so the first 6 posts are displayed differently on the homepage than posts 7 and on. The first six posts should grab their featured thumbnail images and use them ...
1
vote
2answers
32 views

Transient not working for custom loops

I'm working at a WordPress theme. Since I need to display featured posts, related posts, some widgets with recent posts and so on, I need to use multiple custom loops. Because of this, the number of ...
1
vote
1answer
37 views

List all posts commented by current user

I need a page to display all posts (in Foods custom post type) that have comments by the logged in user. The list just needs to show the title with link to the title. Is this possible? What I've ...
0
votes
0answers
36 views

Wordpress loop only displaying one post

I don't know enough PHP perhaps to recognize immediately why the loop in my wordpress theme is only displaying one post and so I humbly ask for assistance. <div class="container"> <div ...
0
votes
1answer
18 views

Display one post on category.php: Wrong featured image

What I want When a user opens a category link, there should be automatically displayed the first queried post. My query looks like this: <?php global $query_string; $posts = ...
-1
votes
1answer
23 views

Query for page content, and query for posts on the same page?

I'm having trouble with trying to make a blog listing page, I have a page in Wordpress called Blog. Within this is some written content and that's it. I'm using the following query to make it output ...
1
vote
2answers
49 views

User Defined order on get_categories?

Below is some basic code to call specficic categories to our front page post loop. It works fine, except my client wants the categories displayed in a particular order. I know there are other posts ...
0
votes
1answer
33 views

Blank content php code not parsing advanced custom fields gallery add-on [closed]

I have blank contents where the content for the act gallery code is. I think there is an issue with the code. < ?php /* Template Name: Images scroll */ ?> <?php get_header(); ?> ...
0
votes
0answers
25 views

running queries of multiple post types

I am trying to figure out the query I need to build for my project. I've got a little idea but i am getting confused by all the different query methods and I'm not sure which one to use. I have two ...
0
votes
1answer
19 views

How to overwrite orderby with add_query_var

So I would like to have an archive that displays its posts in a random order. <?php $query = new WP_Query($query_string."&orderby=rand"); ?> But also then if the user chooses they ...
0
votes
2answers
32 views

Escape current post from loop

I'm creating a search widget and for that I use a secondary loop via new WP_Query(); $query = new WP_Query('s=searchTerm'); if ($query->have_posts()){ while ($query->have_posts()){ ...
0
votes
1answer
43 views

WP_Query on custom post type not displaying, multiple loops & get_template_part

I'm having problems getting my testimonials to display. On page.php I have a testimonials section. So I have a loop that grabs the content for page.php, and then a get_template_part('content', ...
0
votes
1answer
26 views

An archive page without post format (just standard post)

I'm trying to get posts with not marked with any type of post types (aside, audio etc). But I didn't find any solution to do this. I thought doing this with custom fields but site has a lot of ...
2
votes
1answer
27 views

Show posts without term

I am working on a product page where I show reviews from my post type 'reviews', if the product page title matches with my term from the taxonomy 'review-product'. Example. Product page title: ...
0
votes
0answers
28 views

How to get rid of extra Untitled Article in html5 document outline when using new WP_Query?

Here is a simplified version of the code I'm using on a static homepage template made for a child theme of TwentyTwelve. I simplified some of the divs used for styling and just focused on the problem ...
1
vote
2answers
35 views

All posts are still shown when adding category argument to query

I've got the following code in my team-type.php file which I'm using to create a custom taxonomy for a member information: function create_team_taxonomies() { $labels = array( 'name' ...
0
votes
2answers
38 views

How do I style the first two posts of a loop

I'm trying to style a single loop to look like so --------------------------------------------- || | || || || | ||--------------|| || ...
0
votes
1answer
44 views

Structure and Display Content from Multiple Pages on Single Page

I am trying to display the content from multiple pages on a single page. However, for each page I need the title, excerpt, content and featured image. The display of each page's content has a ...
0
votes
1answer
30 views

Creating a archive for taxonomy terms, not the term results

So I am attempting to build the first page in my navigation hierarchy to choose product categories. I have a custom taxonomy called collections. I would like to create a page that loops through all ...
4
votes
1answer
56 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                        ...
0
votes
1answer
69 views

How to show subcategories using loop?

i am using wp_list_categories('child_of=54&title_li=') method to display all the subcategories, but it is showing only one, how can i use it with loop to show all the subcategories properly.
1
vote
2answers
73 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 ...
0
votes
1answer
40 views

Redirection loop error after login from a custom post type post

I have created a custom post type called portfolio so such posts have an url like this: mydomain.com/portfolio/post-name/ This is fine so far, however i just found I am having a problem with my ...
1
vote
0answers
37 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
28 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
1answer
44 views

wp-query, pull children of parent page

So here's what I'm trying to do: I'm trying to develop a theme that shows any sub-pages on the parent page. I've gotten this running successfully with a WP_query and a simple loop: <!--show sub ...
0
votes
0answers
49 views

Advanced wp_query - custom date and postname

I'm trying to write a query and sort by: custom date postname (in reverse order) because my postnames have a version string at the end and the latest entry should stay on the top of each other. ...
0
votes
2answers
16 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
37 views

How do I get my custom query to work with search results after the first page?

I am using a custom query in order to ajax load/append additional posts instead of paginating them out like WP defaults. However, when I click the button I've made to load more posts, it loads all ...
0
votes
1answer
26 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
20 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
25 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 --> ...
0
votes
1answer
48 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 ...
5
votes
1answer
105 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 ...