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

WP_Post is not from correct array

A bit of a complicated problem here, but I figured I'd see if I could get any help. My logic is this: WordPress custom post query > for each of the results, factor in distance (calculated ...
-1
votes
0answers
20 views

If Loop has odd number of posts on last page Custom style [on hold]

I browse on your custom style approach , [question]: If Loop has odd number of posts on last page Custom style for last post in it but I encountered a problem like this site ...
0
votes
1answer
43 views

How to make post button to a random post

As you can see on my website http://www.kieshetsnel.nl/emma-watson-natalie-portman/ I currently have an Arrow left and right on the screen. But when i click next post (volgende keuze in Dutch) I ...
1
vote
1answer
30 views

How to connect two custom post types with nested loops

I have 2 custom post types created: "classes" and "teachers". I have created using Advanced Custom Fields plugin a field for "classes" custom post type, a multiselect that helps me add certain ...
0
votes
1answer
46 views

How to check if a product is purchased within the last 365 days before displaying something

I have a WP site using WooCommerce. Our products are made up of physical stock, a download and some links to pages on our site. I had set this up by placing the links to the specific product pages ...
0
votes
0answers
12 views

Query custom post in tag archive

I created a custom post and added the standard Wordpress tag functionality: function btp_work_register_post_type() { $args = array( 'label' => __('Works', 'btp_theme'),'labels' ...
-1
votes
2answers
32 views

Woocommerce linking variations

So I have this array (just taking an example, it's dynamically built up): $v_values = array( array("C1","C2"), array("F1","F2") ); $v_name = ...
0
votes
1answer
13 views

Show all child categories associated to post ID within loop

I'm looping through all posts and I'm trying to output the category nicename related to each post. So if there are categories A,B and C with post X only associated with categories A and C then I only ...
0
votes
0answers
21 views

Creating search.php for Wordpress with custom fields feature

I have seen a Wordpress site which has below features in its search.php section. http://www.example.com/category/film/?directors=Brad%20Anderson ...
0
votes
2answers
32 views

Wordpress get post thumbnail url

Its simple and answered quite often: I want to get the post thumbnail variable. Even if there is a lot of input, I could not make it work for me. Here is my current code I use somewhere inside my ...
0
votes
1answer
18 views

How to make divs the same height as the tallest? [on hold]

I have a loop grabbing the thumbnails, titles and excerpts from the most recent posts and displaying them on the homepage in a column format. I want to make the div that contains title of each post ...
0
votes
1answer
20 views

Custom loop - Isolating post meta output depending on current query taxonomy terms

I have started constructing is a page to display a series of products based on certain criteria. Each product is part of two separate taxonomies, one for brand and one for product size (each product ...
1
vote
0answers
16 views

Sharing post from archive page (loop) doesn't work

On my archive page, I have for each post( I have include in the loop) the possibiity to share the post via facebook via this code: <a href="http://www.facebook.com/sharer.php?u=<?php ...
1
vote
1answer
30 views

Display the_content on click jquery

I'm trying to display the_content of a post on click. the problem I'm having is that it display always display the same content. I mean by on click on read for post A, it display the_content of post ...
0
votes
1answer
35 views

Wordpress call post-ID in jquery

I explain the situation I'm having here: On my home page, I have a list of post being display. I've code to have like a modal box to share this post. Basically, on each post you have a button share. ...
0
votes
1answer
41 views

How to display 3 post per slide

I need to create a sliders contain 3 post title for each slide. I can create it by one title for each slide but not 3 posts Could you please help me This is My code <ul class="overview"> ...
1
vote
2answers
59 views

How to split a loop into two columns

I am running a dwfocus news website, I would like to split my li loop catagory in two section, can some let me know how can i proceed forward, thanks. <div class="headlines" ...
0
votes
1answer
26 views

Post formating on Home page

I've simple question regarding WordPress post looping. I want to achieve something like this on my site: ~ I am running Real estate portal site and I want to display featured property on my home ...
0
votes
0answers
11 views

WordPress Homepage - display set of posts from two categories and a set of products in date order

I'm in the planning process of a WordPress/Woocommerce site. The client wants to have the posts from two categories and her woocommerce products to show together on the home page in date order. This ...
-1
votes
0answers
19 views

Object $post return null inside loop

I have problem inside the looping. Everything is Ok until one of posts while looping return null: if (have_posts()) { while (have_posts()) { ...
-1
votes
0answers
29 views

Woocommerce add new variable product

I have already referred to: http://stackoverflow.com/questions/21667292/how-to-set-attribute-as-variation-in-woocommerce ...
0
votes
1answer
25 views

How to avoid duplicates when creating recent network posts

I'm using this code to get a list of custom posts (with custom fields) from the network for display in a php widget. It's old, but it's working fine: <?php switch_to_blog(4); ?> <?php $ca = ...
0
votes
0answers
22 views

Using simple field variables within a loop

I am trying to loop a custom post type called "room" within a custom post type called "venues". I have venue pages and I have created a custom post type called room which is tagged with the venue ...
0
votes
0answers
19 views

Adding some sort of Label-text to a looped button

To sum up my problem, here's a picture: I've added this text with a hover-fx to a button to explain to users what the button does. I've done so by adding a <div> with another <a>-element ...
0
votes
0answers
25 views

How to pull a wordpress site through <iframe> while being on the same site and avoid infinite loop? [migrated]

I am trying to create a testing site for clients where they can change the resolutions of the site by pressing one of the icons in the header. I've added the icons and wrote jQuery that changes ...
1
vote
1answer
65 views

WP_Query doesn't get sticky post at the top, when used in a page template

I'm creating a theme in which I've created a page template called page_default-blog.php to be used for creating a blog page. In this file I have the following code: $paged = (get_query_var('page')) ? ...
0
votes
0answers
12 views

Loop media by “uploaded By”?

I have a webpage that I want to display images that are uploaded by a certain author. In the backend if I look at media, each image has an 'Uploaded By' attribute, and then it says the authors name. ...
1
vote
1answer
65 views

Prevent duplicate post from dynamic multiple loops

I was trying to list 20 recent posts, and put a post from custom post type on every 5th item. So it's like: Post Post Post Post Post Custom Post Type Post Post Post Post Post Custom Post Type .. and ...
0
votes
2answers
37 views

divide custom field values in div every two values

i have this html mark-up to sort some data <div class="row"> <div class="col-xs-2"> <img src="images/member-schools/ms1.jpg" class="img-responsive"> </div> <div ...
0
votes
0answers
32 views

How to make multiple loops (of different categories) on Homepage but with one echo code

My homepage has 7 similar loops in it. The only differnce between them is the number of posts and the category id. Everytime I want to change the HTML code inside the echo I need to change it 7 times. ...
0
votes
1answer
33 views

Is it possible to add query parameters on the archive page?

I have a custom post type (works), and an archive page (archive-works.php). I would like to hide the non-public posts from the archive page, so I added a custom meta box. I also modified the query to ...
0
votes
0answers
18 views

how do I echo pods fields from a Page Template

I've created a Custom Post Type. I've added fields to the Custom Post Type using Pods. Now I'd like to access the data stored in the Pods Custom Fields in a Page Template. I've started out by using ...
-2
votes
1answer
45 views

Undefined variable: woocommerce_loop [closed]

Today I've updated my woocommerce plugin and get the following error on my website: Undefined variable: woocommerce_loop My loop looks like (a slight modification of the archive-product template ...
0
votes
1answer
22 views

Modify WordPress loop after it has been run

I am trying to build a category page that displays 8 posts from the category, but when the user clicks on "Read More" (which does an Ajax request and displays more posts), I would like the loop to ...
0
votes
1answer
60 views

Display subcategories in dropdown

I have the following code on my website: <div class="blog-cats drop"> <label class="custom-select"> <select class="styledSelect1" name="archive-dropdown" ...
-1
votes
1answer
40 views

Custom post order returning posts from other categories

I am trying to order each post in a category by custom field (using Advanced Custom Fields Plugin) $the_query = new WP_Query(array( 'posts_per_page' => -1, 'meta_key' => 'adult_price', ...
0
votes
1answer
29 views

Custom Loop Event Page

I need to create a loop in an event page with pagination of 10 posts per page. The way I want to do it is a little bit complicated. For example, with current date May 1, 2015: January 1, 2015 - ...
0
votes
0answers
8 views

Creating a Publication posting on site from another site

Options : Create a New Post in a web -1 from another web -2 . or Everything is created in wordpress -2 be " copied " to the web -1 I 've used the built multsite with ThreeWP - Broadcast, but has ...
0
votes
0answers
32 views

Reorder results of select query by distance

What I'm trying to achieve is a store directory listing nearby stores, ordered by distance. I've managed to grab all the stores within the specified radius and display them, and also calculated the ...
0
votes
1answer
19 views

Remove posts_orderby filter then add it back in

I'm using remove_all_filters('posts_orderby'); to remove the order for a query. For a query further down the page I need the filter back. How do I add it back in?
0
votes
1answer
55 views

Wordpress Plugin manipulate have_posts()

I want to develop a plugin, which changes the post order on the blog page, I think I need to manipulate the have_posts() function. How can I do this?
0
votes
0answers
27 views

Query post by category using only one custom page template

Is it possible to query a post by category using only one custom page template? Basically I created a custom post called "Vehicle" and each post are assigned to a different a category. Instead of ...
1
vote
1answer
61 views

How to solve suspected memory issue in custom WordPress loop?

I have written a plugin that adds a "Where did you hear about us?" question to the WooCommerce checkout page and shows the results (as a simple horizontal bar chart) in a wp-admin page. The plugin ...
0
votes
2answers
69 views

How to create custom page templates with default page layout framework?

I'm writing a custom theme. Most of the content will use the regular index.php, header.php and footer.php. The index.php looks like <?php get_header(); get_sidebar(); ?> <div ...
0
votes
0answers
29 views

Display taxonomy title in my loop?

I'm using a tab to display my taxonomy, I would like to be able to display a specific taxonomy (for example: sectors) from my Custom post type. But my code doesnt seem to work . . .If any body has ...
0
votes
1answer
37 views

pre_get_posts with get_posts

So in the template I've multiple featured posts and sliders and 2 default loops. I use get_posts for everything except default loops (obviously). Now the issue I'm having is excluding get_posts ...
0
votes
3answers
48 views

loop query exclude meta_key with meta_value

Hi I use a loop like this: // show all active coupons for this store and setup pagination $paged = (get_query_var('paged')) ? get_query_var('paged') : 1; query_posts( array( 'post_type' => ...
0
votes
0answers
21 views

Call grand-children of page outside a loop?

I am knocking my head to a wall since couple of days, Here is the situation ( I attach a graphic to explain more clearly what I want): I have one main page-template. Who is the parent of three ...
0
votes
0answers
41 views

Loop Wordpress Next and Previous Post

I have a next and previous post link in Wordpress but if you're viewing the very last post or the very first post you get a blank space where no other posts meet the condition. How do I edit my code ...
0
votes
0answers
25 views

Comment form on page redirects back to frontpage

I have a page template with a single WP_Query what displays only one posts (Depends from the value of the $_GET. Example: domain.com/custom/?id=2). I would like to add a comments form I used ...