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

Thumbnail of the latest posts page

I have a page "Blog" and it's set to display latest posts. This page itself has a thumbnail, and I want it to be displayed in header. Every other page/post has same layout and thumbnail shows in ...
0
votes
1answer
215 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 ...
0
votes
0answers
46 views

Humanmade | Custom meta box class: How to display a repeatable meta box group?

I'm using the Humanmade | Custom meta box class to add meta boxes to my themes admin pages. I have integrated the class and have been enjoying the use of adding meta box's to my current projects ...
0
votes
1answer
51 views

The loop starting at a certain ID

Is it possible to start the loop from a certain post ID? I would like to get all the post starting at a certain ID, decendingly. To explain, I have to make sum assumptions first. Assume that my ...
1
vote
2answers
26 views

Listing subpages title and content and styling the first iteration differently

So for now, every iteration looks the same and it's been a while since I dealt with php so could you help me? <?php $pages = ...
3
votes
1answer
496 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 ...
0
votes
0answers
29 views

Display posts from category in page

I am trying to use a shortcode to display a loop of posts from a category. I have the shortcode working but it is only displaying the actually category names within the custom post type and not the ...
1
vote
2answers
14 views

Latest Post Styled Different Than other Posts

I'm just completely mixed-up with this. I need the 1st post of the loop looks differently, as a kind of magazine style, you know: bigger thumbnail and bigger title. I tried already nth-of-type in ...
0
votes
3answers
29 views

Exclude subcategory from wp_query

I've got a simple loop, that goes through the category street-style: $street_style_tags = array( 'category_name' => 'street-style', 'posts_per_page' => 25, 'post_type' => 'post', ...
0
votes
0answers
27 views

How to output data from meta box with cloned fields?

Just to let you know, i am at a beginner level with PHP, so please bear with me : ) Also, I looked at this post and I did not find it helpful in my case, so I am making a stab at it here. (Meta Box ...
1
vote
2answers
31 views

Display content from custom post type if match to main post category

I solved the problem of displaying from a custom post type in a post with this solution, however, I want to filter even more and only display the posts from custom post type that match the main post's ...
0
votes
4answers
71 views

How to exclude categories from recent posts, recent comments & category widgets?

I use the bellow function (thanks to @helgatheviking!) to exclude categories from the wordpress loop. It works very well - posts of selected categories are excluded from the loop on the main blog ...
0
votes
3answers
36 views

Saving return value from the_author_posts_link()

As you know, in the loop, the_title() function displays (echos) the post title to the screen, and get_the_title() returns it (so it can be saved in a variable). The same is true for the pair ...
0
votes
2answers
40 views

Order by multiple meta keys on wordpress

After multiple research I didn't find the correct answer to my question. I just need to order my custom post type by date and then by time (format: 18:00). Here's what I tried: ...
0
votes
0answers
12 views

Building a plugin: use offset values, save to database, call values on frontpage in loop

I first posted this on StackOverflow, but now I realise that this is probably more suited for this site. Updated 26 Feb. 2014 I already that this question will be quite elaborate, so for everyone ...
0
votes
3answers
1k views

Custom Post Type on Homepage - Studiopress Genesis Framework

I have used to below function to register a new 'guide' content type: add_action( 'init', 'guide_post_type' ); function guide_post_type() { register_post_type('guides', array( 'label' ...
0
votes
1answer
28 views

Loop through all posts, show attachment if there

I've created two simple foreach loops: one for all posts, one for all attachments. I want it show every post title, and if there is an attachment, show that attachment. I have, thus far: ...
0
votes
1answer
33 views

Running the Loop outside of WordPress

I have a static website and WordPress installed at mywebsite.com/blog. I have a page on my external static website which displays a list of all posts [per the codex][1] using the following code ...
0
votes
0answers
130 views

List post in wp-admin and sort them

this is my first public plugin called Sort posts in taxonomies. With the plugin I intend to list regular posts and custom post_types in the Category(Taxonomy) edit page in wp-admin. Further give the ...
0
votes
1answer
40 views

Get the ID of the current post's child category

A client of mine wants to create a simple "related posts" loop that shows 6 of the most recent posts that match the current post's category. The issue is that every one of their posts have the same ...
0
votes
1answer
19 views

Getting posts from multiple users?

Using a third party plugin that allows users to follow each other, we can retrieve the users being followed like so (commented):- <?php if (have_posts()) : ?> <?php global ...
0
votes
1answer
31 views

Does query_posts have an effect on get_the_category?

I am having trouble debugging a situation, and I think some better background information on how these systems work would be very helpful. I know that the use of the function query_posts is strongly ...
0
votes
1answer
17 views

Two loops in one function

I am trying to get this function to work with jquery tabs, and I've gotten some of it to work. Right now the function correctly puts out the <ul> <li>item1</li> ...
0
votes
1answer
31 views

Style first 3 posts differently with WP_Query [duplicate]

I've got the following code, which gets the first 3 posts. However, I am hoping to style each differently with if statements. But when I add if statements (to determine whether it is the first or ...
0
votes
4answers
49 views

Page template not displaying

I dont get why this isnt working. I have a custom page template: page-politics.php (http://pastebin.com/J35dXptv). It should look similar to this page: But its displaying this: Ive double, triple ...
0
votes
0answers
36 views

JQuery is only applying to first post in loop

I have a JQuery script that creates 'arrows' that allow for my textbox to be scrollable, the problem is JQuery is only apply it to the first post (you can see none of the other posts have the arrows). ...
0
votes
1answer
46 views

problem with using serveral loop in wordpress theme

i am using several loops like this <?php $posts = get_posts('numberposts=1&order=DESC&orderby=post_date&category='.get_cat_ID( 'سیاست' )); foreach ($posts as $post) : ...
0
votes
1answer
20 views

filter a loop base on specific category

i am going to filter my loop base on the category the problem is that when i am using the following code it display all my post. // Query args $custom_cat_args = array( 'posts_per_page' => 15, ...
0
votes
2answers
28 views

Pulling current post/page data into header.php

I want to pull some post/page specific data (author name, post ID, publish time, etc) into header.php to be used in meta tags. I am having trouble figuring out the most efficient way to do this. It is ...
1
vote
1answer
26 views

First post of each category

I'm trying to create a simple loop, that gets the latest post of 3 selected categories. I've searched for something similar to learn from, but most are overly complex. At the moment, I have: ...
0
votes
1answer
506 views

Need some help with “the_widget()” function

I am trying to create code to display certain default WordPress widgets on my e-commerce site. I have 6 content boxes which display WordPress widgets: • Pages • Latest Posts • Archive (last ...
0
votes
1answer
40 views

Second loop pagination changes URL, not content

I'm reasonably new to WordPress and I believe I am missing something conceptual here. I have assigned a static post to be my front page. My front-page.php template begins with a standard loop: ...
0
votes
1answer
42 views

how to use custom loop in the_content filter

Trying to use the the below code for my CPT 'state' like add_filter('the_content', 'my_custom_loop'); but the trial and error is not getting me anywhere. I can't use a single-{post_type}.php since i ...
0
votes
2answers
53 views

WP_Query of Category Not Showing First Post

I have the following loop, and only this loop, in my home.php file (apologies if I didn't paste the code properly). I have populated lorem ipsum posts, and noticed that of the five posts only four ...
1
vote
1answer
20 views

How can I modify the loop from a plugin without wiping out other filters?

I am trying to modify the_loop output from a plugin. I've looked into pre_get_posts, which definitely works, but I need to filter the loop by a custom taxonomy. I can do this with ...
1
vote
2answers
5k views

WooCommerce Product Page Loop - Output All Product Thumbnails

http://69.89.31.200/~horologi/shop/ I'm working on the site above and the client has requested that on the shop page, all the product information is displayed on that page, including all product ...
1
vote
2answers
41 views

Best way to assign post position in a news site homepage? (no categories, no sticky posts)

I'm currently redesigning a local news website. The old design used a whole lot of categories to handle the position of the content in the static homepage as in "top news", "middle box", "left box" ...
0
votes
0answers
18 views

Sort Post by Author Meta Field?

Im trying to make a High Scores table. The scores are stored in the user profile as an author_meta. Im not having any problems getting the scores from the post, what I cant do is put them into an ...
0
votes
1answer
18 views

How can I pull information from my loop and divide them seperately?

I've created a Custom Post Type that I'm trying to implement into a CSS slider. To do this I've created a custom template and added counters to get unique ID's for every new post that get's pulled. ...
0
votes
0answers
61 views

Infinite Scroll on a loop?

I have a home page with four different loops (different category's) On one of the loops I want it to display five posts but also have the infinite scroll on it. I have installed the infinite scroll ...
0
votes
1answer
41 views

How to include custom post type posts on a page?

I need help adding a Portfolio page to one of my main Pages. I don't know what information is needed, so I'll just throw in some of the important stuff. Basically I have my main menu, (Welcome, ...
0
votes
0answers
30 views

post category exclusion in main loop

I have mostly posts from category A. Whereas other categories have very few posts. Due to which my main loop shows posts of category A and other category posts don't get seen much on homepage which ...
0
votes
0answers
11 views

WP_Query & posts_per_page [duplicate]

I have created a custom loop with WP_Query and I am trying to display only 4 posts. I do not need pagination or anything similar. Just the four posts. I am using posts_per_page => 4 to do this, but ...
4
votes
1answer
87 views

How do you get the count of posts in an archive page?

I have a custom posts archive page of the type archive-my_custom_post_type.php and I am using the "standard" loop which consists of the ever-so famous <?php if(have_posts()) : ?> <?php ...
-1
votes
1answer
16 views

Duplicate post problem

I have two loops. One that shows only one post, the other shows four. however i'm getting duplicate posts. Loop one <?php $my_query = new WP_Query('showposts=1'); while ...
0
votes
0answers
33 views

Multiselect value in wp_query

i have been trying to display the post that contain specific tag. what i am trying is: if user search for post related to tagss for example: if user selects the tag Don after submition the query ...
0
votes
1answer
53 views

List all anchor links on a page

I was trying to make a navigation menu of all the anchor links on a page (similar to wikipedia) but couldn't find out how. I tried to find a plugin that could do it, but they only listed the anchors ...
2
votes
2answers
215 views

Auto Refresh Post List after X seconds

i'm new in wordpress, and i really need a help here. My main site, list the resume (excrept) of all posts, with pagination. But when a user publish a new post, the only way to see it on the main page ...
0
votes
1answer
87 views

loop on page makes shortcode fail

I have this typical WordPress page (page.php): <?php the_post(); ?> <div id="rightcol"> <div <?php post_class(); ?>> <?php the_content(); ?> </div> All works ...
1
vote
0answers
85 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: ...