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)

2
votes
0answers
2k views

Display products for a category, sorted by post_excerpt

I'd like to display a list of products for a certain category, sorted by the post_excerpt. The original code I used was this: $args = array( 'tax_query' => array( array( ...
1
vote
0answers
42 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. ...
1
vote
0answers
50 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
vote
0answers
100 views

Get Page content to displayin Bootstrap Modal

Ok I'm a relative novice here, and after looking around I still haven't found the answer to my problem. I'm basically trying to link a Bootstrap Modal to some text in a footer (widget), the content of ...
1
vote
0answers
37 views

WordPress Rewriting the DOM?

WordPress 3.9.1, Bones Theme. I'm setting up an archive page for regular 'ol blog posts. The theory is to wrap each post's information in a permalink. Such as: <?php if (have_posts()) : while ...
1
vote
0answers
54 views

Custom Theme With Custom Loops

There are so many different questions on how to make pages show page numbers at the bottom but I can't seem to use the concepts explained in those to solve my own problem. I know some PHP and I've ...
1
vote
0answers
22 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
0answers
31 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
0answers
67 views

How to show a post if was published less than two hours ago?

I want to show posts only that were posted less that 2 hours ago and have the custom field "¿directo?" with the value "Sí". These are my progresses, but they don't work: Functions.php: function ...
1
vote
0answers
56 views

Sort results by groups of numbers and letters

I have this code: <?php $letter=' '; query_posts( array ( 'orderby' => 'title', 'order' => 'ASC' ) ); if ( have_posts() ) : while ( have_posts() ) : the_post(); ?> <ul> ...
1
vote
0answers
240 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: ...
1
vote
0answers
234 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 ...
1
vote
0answers
89 views

Checkbox doesn't stay checked, conten

I'm using the morefields plugin to create textfields and checkboxes in the dashboard. For a test I have first created a checkbox on 'pages' if it was checked, the frontend showed the text ...
1
vote
0answers
34 views

On single.php, fetch 2 posts created after and 2 posts created before in relation to the actual post (using menu_order)

Looking for a way to on single.php fetch and show the actual post, and then by looking on the menu_order value of that specific post (lets say the post have menu_order value 3 in this case) go and ...
1
vote
0answers
106 views

Custom post type conditional in loop

I need multiple loops on a page and have created them as such global $post; $args = array( 'numberposts' => 3, 'category' => 10 ); $myposts = get_posts( $args ); foreach( $myposts as $post ) : ...
1
vote
0answers
642 views

Loop that displays PARENT PAGE & CHILD PAGE & outputs GRANDCHILD PAGE title and content

I've never posted here, but I'm tired of slapping code together. That said, I would be most appreciative if someone could help me with this. I need a page template that: outputs the PARENT PAGEs, ...
1
vote
0answers
193 views

Listing all term items alphabetically / sorting loop

I have my own custom post type and it has its own taxonomy and terms. Whenever user visits http://example.com/mytaxonomy/myterm I want the page to display all items within this term alphabetically. ...
1
vote
0answers
539 views

Display one post from each term in a custom taxonomy

I am trying to display a list which shows one post (and information about the person posting) from each custom taxonomy term. The code I am using is as follows, but it is instead printing out EVERY ...
1
vote
0answers
65 views

Display posts with comments closed, with pagination?

i'm using a custom query, which needs to display all posts with closed comments. I have this <?php $the_query = new WP_Query('showposts=-1'); ?> <?php while ($the_query -> have_posts()) ...
1
vote
0answers
106 views

Problem getting current post tags to show in a widget

I have tried tons of examples and suggestion on this topic but I can not get them to work. What I am trying to do is display the tags associated with the current post in a widget. I have built the ...
1
vote
0answers
102 views

Modified loop-single-forum.php to work inside of a sidebar Widget, not working on some site pages

So I took loop-single-forum.php, copied it and renamed it, fixed it so the site is calling the copy and then removed what I did not need from it to place it in a sidebar widget. It works beautifully ...
1
vote
0answers
229 views

List authors with the last post title and order by last post date

I want to list authors with last post data and order them by last post date. Now i have this codes but i don`t know how to edit them. // Selects from tables wp_users and wp_posts, selecting published ...
1
vote
0answers
124 views

Order by category titles

I have a category page called 'features' this is all fine, but the posts in the features category also belong to a certain genre of film, and it's this what I want to order the posts by on the actual ...
1
vote
0answers
70 views

Access to Media Library

Im trying to find a way to pull random images from either a post or wordpress's built in image library. Im not sure how to query image uris from a post or the media library - is there a tag or method ...
1
vote
0answers
117 views

Replace default Wordpress search behavior with Sphinx

I want to implement Sphinx Search in my Wordpress site but I'm not exactly sure how to change Wordpress search behavior to use Sphinx. How do I get Sphinx Search engine to replace whatever Wordpress ...
0
votes
0answers
36 views

Show Posts from Single Category Not Working

I have a simple loop that outputs the content of posts and then adds some navigation links at the bottom. Wordpress is set to only show 5 posts at a time. <?php while(have_posts()) : the_post(); ...
0
votes
0answers
27 views

Multiple Page Loops on front-page.php

Looking to build an easily editable front-page.php using multiple loops set to display pages. One way I thought about doing this was making a HOME page, then setting "About us, Services, Team" all ...
0
votes
0answers
12 views

Possible to remove settings from wp_customize?

So, really basic setting here. function Ari_customize_register( $wp_customize ) { $wp_customize->add_setting('header_position', array()); $wp_customize->add_control('header_position', array( ...
0
votes
0answers
24 views

Error Page-Template LOOP

I have this code and I want to create a page under wordpress and apply this code. I save as bcn.php file into Themes folder. I create the page and in Admin menu and apply the bcn template to the page. ...
0
votes
0answers
22 views

WP_Query Order by Specific Post ID First

I'm creating a website where I have a need to show a set of posts from a custom loop but I need to display a specific post first. This post will be dynamically specified in the URI by a $_GET ...
0
votes
0answers
11 views

Display Comments list and a Comment form in home page inside while loop

I am trying to get a list of comment and a comment form in the home page inside while loop for displaying latest post which shows one latest post. I tried with <?php $withcomments = "1"; ...
0
votes
0answers
6 views

Splitting content into two columns and shortcode-slideshow above

I am working on a custom template that will allow me to display a shortcode gallery in full width, and below that, the text from the content of the post in two different columns. I have been able to ...
0
votes
0answers
26 views

How to show 4 previous posts from current article category in Wordpress?

How to show the 4 previous articles on Single Post (single.php), only from current article category? Also if no previous article found, loop from the next articles. Please no plugins... I need to ...
0
votes
0answers
20 views

Show Taxonomy content

I've created a Taxonomy called Collections and also have a custom post type called products. I want to show the top 3 categories on the homepage and then when you drill down into each collection ...
0
votes
0answers
29 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
0answers
16 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
18 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
0answers
46 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
0answers
27 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
0answers
49 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
0answers
34 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
0answers
31 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 ...
0
votes
0answers
32 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
0answers
27 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: ...
0
votes
0answers
17 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
0answers
13 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
0answers
21 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
0answers
56 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'] ...
0
votes
0answers
28 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? ...
0
votes
0answers
35 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--> ...