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
3k views

AJAX with loop filtering categories

I've been researching on how to make my loop with AJAX. I found some codes online and modified some parts but I can't seem to get it to work. This is my code for the loop: <article id="main" ...
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
43 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
66 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
121 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
42 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
56 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
23 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
32 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
68 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
61 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
268 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
267 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
91 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
680 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
194 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
545 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
66 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
107 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
106 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
239 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
125 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
71 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
123 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
7 views

How to add jQuery div element to each image on wp site?

I'm trying to add the "Share" button to each of the attachments inside of the post. I found function that allows to get all attachments on the post: ...
0
votes
0answers
10 views

I'm trying to get post_author and post_content

I'm using foreach ($result as $row) and I can use: <?php echo $row->post_title;?> or <?php echo get_permalink($row->ID);?> and they work fine. But i cannot use : <?php ...
0
votes
0answers
26 views

$post breaking container loop

Problem I have a foreach loop grabbing posts inside an advanced custom fields repeater. When it's finished looping through posts it breaks the repeater. I believe the problem is with $post as far as ...
0
votes
0answers
21 views

Popular posts from 7 days loop

I'm trying to create a "loop" which will display Popular Post from a week or any other timeframe. What's the best way of doing it? Also, is it possible to order the posts by views? EDIT: Here is ...
0
votes
0answers
18 views

Search for posts with specific tag inside custom page template

I'm developing a Wordpress blog where there are two custom pages - i.e., different from index.php. In there, there are two albums of photos, with the photos listed on a div above. I've put an input ...
0
votes
0answers
16 views

Custom Loop and the_title();

I have used custom loop to process posts however, the loop cannot get the right title or the custom fields. I am using ACF plugin The weird thing is that the loop gets the right content through ...
0
votes
0answers
24 views

index.php is only displaying current month's posts?

The blog portion of my WordPress site (a corporate website) utilizes index.php as the default blog page. However, while the page properly shows the PAGING for the other 40+ pages of blog posts, the ...
0
votes
0answers
15 views

Order main loop by category and then post_date

I'm creating an "announcement" post category. I'd like those posts (using the category id) to appear first in the main loop sorted by post_date desc and then the rest of the posts sorted by post_date ...
0
votes
0answers
23 views

How to add an if statement for one of the custom fields on the following loop?

I have a bunch of custom fields on one of my post types, that is displayed randomly but in a fixed order. The names of the custom fields are always the same, and for every loop there is an increasing ...
0
votes
0answers
52 views

Multiple Loops on category.php with pagination on last loop

I'm trying to achieve what should be fairly simple but I've hit a brick wall when trying to paginate the last of three loops on the category.php template. I've read just about everything I can find on ...
0
votes
0answers
19 views

Get posts by current taxonomy term child term

I am trying to create two different wordpress loops, each one will be using a custom taxonomy called 'walls'. Loop one: get posts by child term of the current pages term. Loop two: get posts by all ...
0
votes
0answers
28 views

How to generate custom loop indexes

Besides the regular taxonomies, such as category, tag, author, archive, I also have some special indexes to display, such as list of all sticky posts, simple chronological index of all posts, top ...
0
votes
0answers
44 views

Help paginating custom loop

i'm trying to add some sort of "load more" button every X posts in this loop: <?php if(is_home()) : ?> <section class="pages clearfix"> <div ...
0
votes
0answers
19 views

Facebook Share Link Not Correct

I have a WordPress site that when you click the Facebook like button it likes the wrong url. If I inspect the web page, the url that is inside the like widget is always the same URL no matter what ...
0
votes
0answers
23 views

Running posts thumbnails in flexslider

This is what i'm trying to achieve: Front page with 10 posts, with three first posts shown in a slider (flexslider) and the rest shown as regular excerpts underneath it. Ive managed to do it, this is ...
0
votes
0answers
54 views

Link (by categories) to the first and last posts in custom post type

Link (by categories) to the first and last posts in custom post type For a new theme, I created a “story” custom post type. The main content has a different style than the blogging part, with ...
0
votes
0answers
31 views

Archive sorted by month - separate

I was looking for my answer in this forum but without success (so far..). Case is following - I have a news page with sidebar that shows archive (last 12 months). I'm using following code: <?php ...
0
votes
0answers
42 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
22 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
30 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
61 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
16 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
28 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
32 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 ...