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

Grouping posts by Custom Taxonomies and wording by date

I have already figured out how to create a loop that pulls posts from a Custom Posts Type that I created and grouping them by terms of a Custom Taxonomies. Sorting of terms Alphabetically works ...
0
votes
1answer
17 views

Where to find the code used to render a page that has a shortcode and a template defined?

I'm new to WP and trying to configure the 'My Account' page on a WP site. The site uses the Paid Memberships Pro (PMP) plugin. In the WP admin console > Pages, there is a page called 'My Account'. ...
0
votes
2answers
20 views

Where should I use post_class()?

I am trying to learn WP Theme development. And as I have understod it is important to use "post_class()" since plugins may need to use it. But what I not understand is where I should use it? Should ...
0
votes
0answers
9 views

How to get the categories from Related Posts using “Posts to Posts” plugin

Sorry if this has been answered elsewhere — if it has, I have been unable find the answer — or if this seems like a basic question. But I am trying to use the Related Posts functionality built into ...
1
vote
1answer
19 views

Define Function in functions.php or plugin and call in theme loop

I need to define a function in functions.php or a plugin and be able to call it inside the theme's loop & outside. Example; I have a $product_price = get_post_meta(get_the_ID(), 'product-price', ...
0
votes
1answer
10 views

Post Format problem

I'v tried really a lot of solutions, and the one that works, it works half a way. Inside single.php I'v added <?php while ( have_posts() ) : the_post(); ?> <?php if( ...
0
votes
0answers
6 views

Why is this custom taxonomy page showing all tags rather than the relevant tag?

I have a custom taxonomy 'keywords' which I am using to tag my custom content type 'publications'. I have a custom taxonomy-keywords.php page, and a loop of Publications using page-publications.php. A ...
0
votes
0answers
40 views

How to retrieve sticky post with Visual Composer's loop builder?

So I have a simple custom shortcode function build under Visual Composer with vc_map. <?php /** * Blog Posts * */ if( function_exists( 'vc_map_get_attributes' ) ) { $atts = ...
0
votes
1answer
72 views
+50

Display Authors Comments on Profile Page

Hi I am trying to display a authors comments on their profile page (author.php) however both codes I tried, seem to display everyone's comments. Also the second code method is suppose to link to the ...
0
votes
0answers
22 views

Category filter with load more ajax

What I am trying to do is to do an Ajax request to filter posts on category click depending on the category id, then apply load more posts by ajax. Problem: when I fire the ajax call by clicking on ...
0
votes
0answers
26 views

When can a template skip the loop?

I've reached another point with WordPress where something simple is stumping me. In working with an older theme, I have some page templates that do not call the loop. They simply use ...
1
vote
1answer
19 views

Only display videos and images in the_content() within loop

The issue I am trying to solve is within the WordPress loop, I only want video embeds or images to display, not any text. Currently, when creating a new post (Standard format) in the WordPress ...
0
votes
1answer
33 views

How to call custom single post?

newbie here playing with php stuff, wanna learn. So the problem is. I have created custom posts and data from those is shown in a widget. Now i want to create custom single posts for those custom ...
0
votes
1answer
9 views

Get meta value when the page is a blog archive

I'm using custom metaboxes on my pages. For example: header icon. I created a page for the news on my site. I selected it as a blog archive page under Settings->Reading page. Unfortunately I can't ...
0
votes
0answers
20 views

How do I prevent an infinite-loop. wp_insert_posts + JSON

I'm downloading posts from JSON file with this code: $bands = json_decode(file_get_contents('json file url'),true); $arrayLength = count($bands); for ($i=1; $i <= $arrayLength-1; $i++) { ...
0
votes
0answers
7 views

I want to show a list of all the custom taxonomies, and under each a list of some posts that match that

Does anyone know how they might do that? I imagine it would involve getting the list taxonomies, and then iterating through them with php to, and for each taxonomy item, querying the posts and ...
0
votes
0answers
8 views

Category page that displays 3 posts from each subcategory

Alright, so my main menu I am adding category "MainCat" that has subcategories i.e "SubCatOne" "SubCatTwo" etc.. When I click on that page I see all posts from all categories on it, unorganised (below ...
0
votes
1answer
15 views

WP_Query secondary query failing

I'm needing a couple queries on front-page.php and am at a loss why this is not working. My first query works fine, however, my second one specifying the category (or even nothing at all) never ...
0
votes
0answers
7 views

Loop using selection field to display content ACF

I 'm trying to create a loop to show only the contents of a multiple choice selection I have in the ACF ! I tried to do the consultation via WP_QUERY as explained in the ACF site , more does not work! ...
0
votes
1answer
26 views

Exclude first post (sticky or not) from the loop using query_posts()

I'm using query_posts( 'offset=1' ); to exclude the first post from the loop. However, if the first post is a sticky post it will be shown and the second (non-sticky) post will not be shown. Is there ...
0
votes
1answer
27 views

numberposts not responding to wp_reset_postdata()

I am working on a loop where I want the content (from 2 separate categories) to be displayed like this: 1 large format post, 1 random product, 2 small format posts, 1 feature post ...repeat. In order ...
0
votes
1answer
18 views

Returning One custom taxonomy term name

I have a custom taxonomy called cities and right now the only city is las vegas. I am trying to use the code in question to echo "Las Vegas" - for the posts that are associated - on the search results ...
0
votes
0answers
17 views

Problem with pagination in custom loop on front page - no back link

I have certain problem: I have several queries on main page. When I call new WP_query on front Page (custom loop in main loop), make custom pagination, but it doest work in case if I want "Previous / ...
0
votes
1answer
26 views

Tricky Custom post loop

I'm building a site using "theretailer" as a base and I cant figure out where to place code to get the loop to work for a custom post type "News"? the loop the theme uses is ...
1
vote
2answers
37 views

Should I use loop in the single.php file?

I read many tutorials, and checked many premium/free theme's source and most of them use loop in the single.php file. The single.php file only displays one post, so I think the_post() is enough, ...
0
votes
2answers
24 views

Echo Most Recent Sticky Post in Loop?

I am looking to echo the most recent post in the loop of content. Only 1 post. Do I need to put some sort of parameter on the following code: if (have_posts()) : while (have_posts()) : ...
0
votes
2answers
19 views

How do I know the 'meta_key' for ordering my custom post type

I want to order my custom post type called sermons by sermon date, not the date entered. See here: http://codex.wordpress.org/Class_Reference/WP_Query#Order_.26_Orderby_Parameters How do I know the ...
0
votes
0answers
10 views

get posts of taxonomy parent?

I'm new with custom post type - taxonomy. I created a template page to show list of products in custom taxonomy but I don't know how exactly to do. Example: Category SubCategory ...
0
votes
0answers
34 views

Modify category archive page loop on functions.php

I was able to modify the query on the category archive page using global $wp_query; $args = array_merge( $wp_query->query_vars, array( 'tax_query' => array( array( ...
-2
votes
0answers
14 views

Nested loop in a carouFredSel [migrated]

Im new with nested WP loop.I really got trouble with this and cant solve by myself coz it's beyond my skills. I want to loop <div class="groupitem"></div> which will show total 16 ...
0
votes
0answers
20 views

custom query - offset to pagination

I'm trying ot add a custom query to my pagination - category page. here is the code how it look like: <?php /** * The template used for displaying Blog loop * * Use for index/archive/search. ...
0
votes
0answers
11 views

Is there a way to query for standard post formats along with other formats in a single query?

Let say I want to query for standard post formats along with video post formats excluding all the other formats. I can imagine the query like this: $query = new WP_Query( array( 'post_type' ...
0
votes
0answers
23 views

Displaying multiple custom meta fields on the fronted

I am trying to simplify how I display multiple metabox entries on my front page through a custom theme panel. As of right now I have a custom panel called explore which is programmed in my custom ...
0
votes
1answer
22 views

different for loop if screen resolution < 1000px

I'm trying to have a different loop for different screen resolution... Example: one loop if my resolution is higher of 1000px widht, another one if lower of 1000px. I tried this: <div ...
0
votes
1answer
30 views

WP_query for posts with same post type AND same post category

I'm trying to display 'related articles', I do this now like this: <?php $exclude = get_the_ID(); $args = array( ...
0
votes
0answers
42 views

Fake post on the fly with ajax

I would like to generate one fake post on the fly in the admin panel. My aim is to use fake content to retrieve the_title(), the_content(),the attachement url,... I will use this to display different ...
0
votes
0answers
12 views

Listing related taxonomies

I have two custom taxonomies: "Language" and "Technology". When viewing the archive page for posts that are in a particular "Language" I would like to display all the "Technologies" that these posts ...
0
votes
0answers
17 views

Query for showing posts where the gallery custom field, ACF gallery custom field plugin, is not empty [closed]

I'm using the gallery add-on for advanced custom fields wordpress plugin to add images to individual posts which I then display as a gallery using liquid slider. On a single post page I display the ...
2
votes
3answers
55 views

Cannot access current post's ID in custom plugin

I have a plugin that prepends an upvote box to the_content of a single post, sends data via AJAX back to the main plugin PHP file and calls a function to update a database value on success. Here is ...
0
votes
1answer
36 views

Get_template_part() problem with the_content()

I am creating one page wordpress theme - i am new to wordpress dev. The one page website have sections which represents pages. So every section on front page is page created via admin panel. There is ...
1
vote
0answers
15 views

Pagination with an array of post objects?

I am curious, I have the following code: foreach ($this->networkBlogs as $siteBlog) { switch_to_blog($siteBlog['blog_id']); foreach (get_posts() as $postObject) { ...
0
votes
0answers
18 views

loop all posts by category

I have custom post type and taxonomy. post_type = product taxonomy = Products 2 level of taxonomy. Living room -Sample tax under living room -more -more Kitchen -sample tax under Kitchen -more -more ...
0
votes
0answers
53 views

Loop breaking after each category instead of posts-per-page property

I need to have my menu page layout in this format Totally I have 67 posts so I want 3 columns in this way in first column I need to have 15 posts and in remaining 2 colums 30 and 30 all this columns ...
0
votes
1answer
44 views

Admin login not working, because: wp-admin%2F&reauth=1 redirect

I want to login my WordPress site, but i can' because the login always redirect to this: http://testsite.com/wp-login.php?redirect_to=http%3A%2F%2Ftestsite.com%2Fwp-admin%2F&reauth=1 1, I add ...
0
votes
0answers
10 views

Template included with plugin doesn't return all posts for custom taxonomy

I'm in the process of developing a plugin with a custom page template (using template_include) with a loop that retrieves all posts with a custom taxonomy. I tested the code using the same templates ...
1
vote
1answer
26 views

Filtering The Loop For Single Page and Blog Page

I want to start a div when loop starts in a single page ( also in the blog page ). And end that div when loop ends. Obviously using any filter hook or action hook. Thanks In Advance
-1
votes
1answer
41 views

Do not show all post from all categories, just show posts from category in current loop

I have following loop that show all children categories of a parent category(id = 3) The first loop i want to show every child category in a parent div (destination-tours) The second loop i want to ...
0
votes
1answer
37 views

Custom WP_Query doesn't display all posts

I'm building an options page which allows users to choose three posts and three custom images that display on the site's front page. I am using the Settings API to create a custom WP_Query which pulls ...
0
votes
0answers
44 views

Custom Loop and Infinite Scroll

I am using customized version of _s theme where I have Product CPT. In the following files, I need to use Infinite scroll (provided by Jetpack) - archive-products.php taxonomy-[tax-name].php ...
-1
votes
2answers
24 views

make get_post work in the loop

I'm getting a post by id with get_post(); $post = get_post(17); $page = get_post_meta(17); setup_postdata( $post ); include($page['_wp_page_template'][0]); After getting the post I include a ...