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)

1
vote
0answers
70 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
113 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
132 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
323 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
136 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 ...
0
votes
0answers
8 views

Timeout error 504 with 2 query_posts , how can I make them work?

Im experiencing a error: ERROR 504 - GATEWAY TIMEOUT I have this loops that works fine IF in logged... if not, it doesn't work... Update: I have deactivated one of the query_posts and it works. ...
0
votes
0answers
12 views

Redirect loop in WP Admin with SSL

we're running a membership site on the latest Wordpress 4.5.3 hosted on Bluehost. We need to move the website to SSL so made some changes in .htaccess, wp-config.php and added Wordpress HTTPS plugin ...
0
votes
0answers
18 views

Prevent the Loop from running on tags page

I wrote a custom post query for the tags page (tags.php), which queries all posts. I therefore do not need the Loop on that page, because it only queries those posts related to the tag. Is there any ...
0
votes
0answers
10 views

How to insert a product programmatically in DB?

I need to know what the minimum information required to insert a product in woocommerce database and make this product active in the virtual store. I need this for an API implementation in my ...
0
votes
0answers
13 views

How do I edit The Loop? - I want to change the layout etc

I know HTML and CSS but not PHP. I am trying to edit the way that the list of Posts are displayed when the visitor clicks on a category. I am using Wordpress with the Genesis Framework and the ...
0
votes
0answers
37 views

jquery Load All Wordpress Post and Pages Into Div Using AJAX

Ok So I am working on my first Wordpress them based off html5 template that I created myself. Right Now On the site I have a continous music player. It allows the users to listen to music while ...
0
votes
0answers
13 views

Filtering search results for nested loops

So I have a list of companies that have counties and cities. I need to be able to do something like /findmanagers/miami-dade/ and then build a query that fetches all the companies we have listed ...
0
votes
0answers
28 views

Custom Page Load by wp_query

Is there a way I can use wp_query to retrieve custom pages and posts, and display them on the front page of my WordPress site? I'd like to do that for every custom page I have, to end up with a one-...
0
votes
0answers
24 views

Using custom query on a custom page for a custom post type

I have setup a custom page (page-mypage.php) and I want to list all posts of a custom post type when I use the loop in my custom page. I'm using pre_get_posts hook to modify the query. Problem: In ...
0
votes
0answers
13 views

modifying variables passed to the Wordpress LOOP, with IF/THEN?

good evening, i'm trying to make my coding as modular as possible. my site uses three different LOOPs, each to accomplish a different task with my posts/pages, and i've got each loop on its own file, ...
0
votes
0answers
10 views

Popular posts with Varnish ESI

I am trying to get Varnish ESI to work with displaying the most viewed posts on a new blog I am working on. Here is my current script; In theme file: <esi:remove> <?php get_template_part( '...
0
votes
0answers
14 views

Retrieving category pages from subcategory returns empty sets

I've a category overview page. It shows its subcategories. These subcategories have subsubcategories which are pages too. I'd like to retrieve those (title, permalink and excerpt) but so far my ...
0
votes
0answers
26 views

Exclude Featured Image Attachments from Wordpress Search Results

I'd like my search.php page to show all attachments except featured images (because they appear as duplicates of the posts that use them). I have seen some examples that do this for a query, but can'...
0
votes
0answers
21 views

Display Posts in Admin Page

I create a admin page. Now I need to display posts in that page. Should I use WP_Query or get_posts()? (Pagination should be there) Note : I have read When should you use WP_Query vs query_posts() ...
0
votes
0answers
16 views

add date of most recent custom post type

I have a custom post type called products, it is categorized by a custom taxonomy called product_category. I'm trying to have a "last updated on" note on the taxonomy archive pages. I was hoping ...
0
votes
0answers
29 views

How to query post from sub-categories on category archive and display posts?

On a custom taxonomy archive from the taxonomy called 'books' (taxonomy-books.php) I want to list all subcategories that are assigned to the parent category. And then for each subcategory I want to ...
0
votes
0answers
13 views

Sticky posts with conditional taxonomy check

I have two different taxonomies with the same terms. so let's say: Places: Russia, India, Jamaica. Sticky Places: Russia, India, Jamaica. Now i want to create a loop which checks if a post has two ...
0
votes
0answers
41 views

WooCommerce: Making a loop create divs of categories, with category products inside

I have a php/wp script written which in theory should print a div with a category name, description, and all of its products inside. The code looks like this: <?php $args2 = array( 'taxonomy' =&...
0
votes
0answers
22 views

Duplicate Custom Posts

I am having trouble with a site duplicating posts. It will duplicate "page 2" on "page 3" and it will duplicate one other specific post. It also isn't showing all the posts, but I think this has to do ...
0
votes
0answers
18 views

WordPress loop by three meta values with random order

We have three custom fields with names plan_name1,plan_name2 and plan_name3. Need to check if these meta keys has values (1,2,3) OR (2,3,1) OR (1,3,2) OR (2,1,3) OR (3,2,1) OR (3,1,2) We mean ...
0
votes
0answers
23 views

Terms showing empty inside a loop

I have the following problem: I have 2 taxonomies that belongs to a custom post type What i want to do: Loop = taxonomy 1 loop = taxonomy 2 loop = post type My code works but, it shows ...
0
votes
0answers
48 views

wp_get_archives doesn't work with 'post_type' with WordPress 4.5

wp_get_archives support the post_type parameter from 4.4.0, so I decided to add a <select> on the cpt's archive page. Unfortunately wp_get_archives returns with NULL. Do you have any idea what'...
0
votes
0answers
42 views

Display category name only once inside loop

I have been researching on how I can output the category name on a wordpress loop for custom post only to display only once. If there are any posts under the same category, the category name will not ...
0
votes
0answers
18 views

List posts that are geotagged within a certain area

I'd like to geotag some post on WP with latitude and longitude in a custom field. It's very easy to show a map with this data but what if I want to show all the posts that are geotagged, let say, in a ...
0
votes
0answers
39 views

Omitting the latest entry with custom type and taxonomy term from the loop

My agency has inherited a client with a customized theme provided to them from a separate agency, which farmed the work to another agency off-shore. The documentation for this theme is non-existent ...
0
votes
0answers
17 views

Loop through author and edit post tags

I'm setting up a 'free marketplace' for a friend based on wordpress and a woocommerce theme (makery). Each user has his own shop and products. Both the shop and products are custom posts that belong ...
0
votes
0answers
30 views

why does “else” break “if” statement?

I dont understand why this is happening. The winning code is a hash of the post ID. A link is sent to email with the winning code and a link to verify that youre the winner. Now here is where ...
0
votes
0answers
25 views

Archive page: how to orderby category and then by author?

Is it possible to display an archive page ordering its articles by (sub)categories first and by author (alphabetically) as second level order? What do I need to modify and where?
0
votes
0answers
25 views

loop authors with permalinks to posts for custom post type

I have created a custom post type called "adoptions", I have created an adoption-page.php and a single-adoptions.php. In the adoptions-page.php I have loop which displays all the current post from ...
0
votes
0answers
63 views

WordPress multiple loops on home optimization

I am running an News Website based on WordPress with several plug-ins, including W3C Total Cache on my VPS (Nginx + PHP-FPM) server. The code of our home.php is: <!-- STICKY POSTS --&...
0
votes
0answers
34 views

Sticky post to top of category

I use this code: add_filter('the_posts', 'bump_sticky_posts_to_top'); function bump_sticky_posts_to_top($posts) { foreach($posts as $i => $post) { if(is_sticky($post->ID)) { ...
0
votes
0answers
32 views

WP Pagenavi showing only the first two pages without error

I'm trying to show a complete list of the posts, so I included pagination. The problem is that only it's possible to access the first two pages. If I try accessing the 3rd page(/page/3) for example, I ...
0
votes
0answers
18 views

How can I manually set an order for specific category in Woocommerce?

I have a shop page in Woocommerce where I manually put the order number through the product page. This is fine when they view the entire collection. What I want to do is set a second order number for ...
0
votes
0answers
17 views

Query a custom post type from a different WordPress install?

I have a client who would like to only create his items on one domain, but have a specific taxonomy of that custom post type display on a different domain (this is not multi-site...they are separate ...
0
votes
0answers
22 views

Use audio file like image featured

Attempt to get the url of an audio file in post content to display in the loop of the home page. I can only get it if the file is uploaded at the time of creating the post, but if I go to a post ...
0
votes
0answers
14 views

why is the value of one field different from another if they are filled with the same variable?

A form is submitted containing a users email address. When the form is submitted, the page that processes the form creates a new post, and it sets the value of the custom meta field called 'entryCode' ...
0
votes
0answers
15 views

The Loop doesn't work when using RewriteRule

I am using .htaccess RewriteRule on my page. When user goes to /news RewriteRule actually loads /?nav=news On that page, I use The Wordpress Loop to show recent posts if (have_posts()) { ...
0
votes
0answers
33 views

Loop through custom post type taxonomies

I have created custom post type products and I want to show categories on products archive. I have this code <div class="container"> <div class="boxes"> <?php $cat_args = array( '...
0
votes
0answers
19 views

What is the best way to intercept posts/(topics) as soon as they are added by the user in a Forum in Wordpress?

I need to write a plug-ing for a Forum in Wordpress, that each time a user inserts a post/topic such plug-in is able to intercept the data in the post and then we make our analysis throught a function....
0
votes
0answers
29 views

Get first title post from an author

I want to display first title post from an author on my loop with this code: <?php $number = $count_post; $paged = (get_query_var('paged')) ? get_query_var('paged') : 1; ...
0
votes
0answers
28 views

Developing Wordpress Plugins with storing and exporting thousands / millions of data

I want to develop a plugin that will import and export WordPress users with csv file. But my concern is looping thousands or millions of data without exceeding php execution limit or Internal Server ...
0
votes
0answers
26 views

Set Popular Post by views weekly?

I've tried several times, but still didn't work. Anyone have an idea? EDIT: This actually works, but only get popular post all of time. I want popular post by week. what needs to be added? This my ...
0
votes
0answers
13 views

Pagination doesnt work for first 19 pages

I have this straightforward pagination form that used to work just perfect: function theme_pagination() { global $wp_query, $wp_rewrite; $wp_query -> query_vars['paged'] > 1 ? ...
0
votes
0answers
48 views

Call/link wordpress category with jquery/isotope classes

I am working on the portfolio section of my web, and these codes i have in filter.js script (in wp-includes/js folder) jQuery(document).ready(function(){ jQuery(".grid-item").first().addClass("...
0
votes
0answers
39 views

Wordpress loop uses unmodified posts array, why?

I have this code in a Wordpress template: $prepost = $post; $normal_args = array( // here goes the args ); $normal_query = new WP_Query( $normal_args ); echo 'BEFORE: ' . count($...