Set up The Loop with query parameters. This will override the current WordPress Loop and shouldn’t be used more than once. This must not be used within the WordPress Loop.

learn more… | top users | synonyms

0
votes
0answers
4 views

merging two meta_keys

i want order posts with a combinaison between two meta_keys for each posts .. this combinaison is 'meta_key'=views/post_views_count .. & because i use the query_posts before loop so i have ...
0
votes
3answers
8 views

Get next/prev image/attachment in time with date query

I have a big amount of images in WP, that are not attach to any post. They are grouped in custom taxonomies (ignored in code below). The images get uploaded to WP in random order and the post_date is ...
-1
votes
1answer
14 views

How to do query_posts on tags pages

So I am using the tags.php on my WordPress site to create special featured pages; what I would like to do is create a featured area on the index of every page that contains the first five posts. I ...
1
vote
1answer
15 views

Post count for category and tag

I have this code that counts the result found when a search is made. Here goes the code. <?php /* Search Count */ $allsearch = &new WP_Query("s=$s&showposts=-1"); $key = ...
0
votes
0answers
36 views

Custom post types display [closed]

I have two custom post types created using CPT UI plugin, products and review. I want to show reviews on product page submitted by users. I'm able to submit review using a frontend form how do i show ...
1
vote
1answer
45 views

Better way to display posts from specific categories, in a grid layout

I'm using the following code to display posts from a specific category, in a grid layout, on my home page. It works exactly how I want it to, but I keep reading that I shouldn't ever use query_posts. ...
0
votes
2answers
20 views

Query post category & remove any post id

I have category_id=3 and have 10 post in category_id=3 with post_id= 1=>10 How to show list post category_id=3 with no post_id=1,3,5 value as query_posts('cat=3& -p=1,3,5 &showposts=30
0
votes
1answer
20 views

Wordpress wp_get_attachment_thumb_url full

My code in index: (show all attachment by one post ID) <?php query_posts('p=1498'); if (have_posts()) { while (have_posts()) { the_post(); ?> <?php $args = array( 'post_type' => ...
-2
votes
1answer
30 views

Incorrect posts displayed on category page

I'm using this loop to show my 5 latest posts but even if I'm selecting a category it still shows the 5 latest posts from all category. query_posts('showposts=5'); <?php if (have_posts()) : while ...
0
votes
2answers
28 views

How to order by multiple fields using standard query_posts?

In our archive.php we show all the items which match our selected category. This works absolutely fine. Then we improved it by adding (just before the loop) a sort and upping the posts per page from ...
0
votes
1answer
21 views

show latest authors blog post

how do you display the latest authors blog post? I have the below code: <?php $author = get_the_author(); $args = array( 'numberposts' => '1', 'author'=>$author ); $recent_posts = ...
0
votes
2answers
50 views

Wordpress custom post type

hello i have post_type "product" and taxonomy "price" can someone help me to query that custom post type with the selected taxonomy? my current code is like this <?php $term = get_term_by( ...
0
votes
0answers
32 views

How to get Last post Id of custom post type in wordpress

I want to get last post id of a custom post type in wordpress. For this I tried this code- args = array( 'post_type' =>'soto_property', 'posts_per_page' => 1, ...
0
votes
1answer
29 views

How to get main div html to print a list of posts inside?

I have created a function that lists custom post types with a specific term and prints the html. I'm using it as part of my plugin code. I reused part of this information: ...
0
votes
1answer
20 views

Multiple posts/pages in one page?

I'm trying to create website with index page which will have 2+ different boxs with different content generated from post or pages in WP administration. This page will be looks like this wireframe. ...
0
votes
2answers
21 views

Order for custom field after the loop

I have a table, where each post has a custom field with "region" and "city": 01 > SP > São Paulo 02 > RJ > Rio de Janeiro 03 > SP > Campinas 04 > RJ > Niteroi This query is working ...
0
votes
2answers
36 views

Using $post->post_name in body id causing error: Trying to get property of non-object

I'm getting the following error in my debug.log: PHP Notice: Trying to get property of non-object in /my-wesbite/wp-content/themes/express/header.php on line 36 This is line 36 of header.php in my ...
0
votes
1answer
20 views

Incorrect ordering of custom post type based on time

I have a custom post type as event which accept Custom fields' values as gp_event_date as ( 2015/02/26) gp_event_time as (SIMILAR) to 08:00PM - 10:00PM format. And on the list page, it orders the ...
0
votes
2answers
40 views

How to make an archive page displaying posts in a date range

I'm trying to make a couple of Page Templates for different Pages that should act as an archive to display posts (a Custom Post Type actually) in a certain date range. The website it concerns is ...
0
votes
1answer
48 views

Custom query - get_the_terms not work

I want to to show my customer works in a slide This is my query to show these works. I want to obtain the term of the taxonomy "idm_real_tax" for each custom type record. $query = new ...
0
votes
1answer
66 views

3 Posts in Loop, Show Stickies First

Okay I am starting to wonder if it is even possible to do this! As I've found very little info on the matter online. This is a fresh WP install that I've been experimenting on so that I can work in a ...
2
votes
1answer
94 views

Add field to posts (checkbox) that only one post can have

I am trying to add a field to Wordpress posts (not pages) which would simply include a label and a checkbox. Something like: Make this the sticky post? If check, the key should be set to TRUE or ...
3
votes
3answers
130 views

Query posts distinct authors

I am trying to get post from a category ordered random, but making sure that the author does not repeat itself. So I have this query which works as intended, but there is the chance that the author ...
0
votes
1answer
19 views

How to put forward a blog post

I would know if I can put forward a blog post natively using Wordpress ? For example, I have created 20 posts, but I only show 5 on my homepage. Then imagine that I want to put the 18th at the first ...
0
votes
1answer
62 views

Display 2nd category, only once, as sub-heading, in the loop

I have a Custom Post Type ("Rental"). I am using the code from this article I found to display Rental custom posts on a page, with the Categories of a custom Taxonomy ("Region") as headings between ...
0
votes
2answers
61 views

WordPress custom post type queries

I'm using custom post types and listing them in single-[customposttype].php?type=example <?php if (have_posts()) : while(have_posts()) : the_post();the_content(); endwhile; endif; ?> Now I ...
0
votes
1answer
19 views

query_posts clarification needed

I understand for the most what query_posts does and how it works. I also know it's not good practice to use it. But I would like to know exactly what the "$posts" variable does in this setup: ...
0
votes
0answers
24 views

Optimising specific Query with ACF meta objects

Is there any way I can improve the following query without touching the server, as it's taking around 5-6 seconds to execute, the SQL is outputing as: SELECT wp_posts.* FROM wp_posts INNER JOIN ...
0
votes
0answers
24 views

post by Category not working after setting 4 post per page

I am trying to show 4 posts on my homepage that is working fine but whenever i click on sidebar post categories it still shows the 4 post from homepage i.e the filter doesnot works and it shows 4 post ...
0
votes
0answers
46 views

Order posts by ACF checkbox

I would like to order the posts (archive.php) by listing the ones with the ACF checkbox "Premium" first, could someone please offer some advice?:) This is what I've tried so far: <?php echo ...
0
votes
2answers
54 views

display news with pictures 3 small and one large (loop)

I'm trying to put 4 news with pictures 3 small and one large, have gotten displaying them but the "large" is repeated with the last "small" <?php $b=1; $args = array( ...
0
votes
0answers
89 views

Query Posts with meta_query key in array

I am trying to query posts using meta_query to get a series of dates stored as an array in the key repeat_intervals. I am able to query the first date using the following: global $post; query_posts( ...
0
votes
1answer
56 views

query_posts() with multiple meta data comparisons

I have a bunch of posts belonging to category 6, each having the same meta fields. I'm interested in two fields in particular: "pce_monday_open" and "pce_monday_close", both of which have numeric ...
0
votes
1answer
97 views

Query post order by post and desc not working

I have a query that displays post the order of the post 1 to 10 and front-end added: <?php print intval( $post->menu_order );?>º there shows 1º, 2º, 3º ... 10º must reverse the display but ...
0
votes
1answer
124 views

How to use filter hook posts_join for querying taxonomy terms in posts_where?

For the last few hours, I have been trying to use the filter hooks posts_where and posts_join to search for posts based on taxonomy terms, in this case, the taxonomy is 'category' and the term is ...
0
votes
1answer
84 views

WP_Query condition affects posts_per_page count

I'm trying to create a new WP_Query that displays the last 5 posts from cat 1 that doesn't have a thumbnail. This actually works: <?php $the_query = new WP_Query( 'cat=1&posts_per_page=5' ); ...
1
vote
1answer
33 views

List children on child post

I have a custom post type with children posts. If I'm viewing one of the children post how can I list other children posts that uses the same parent?
0
votes
1answer
90 views

List all posts in taxonomy term

I have a custom post type called anime and a taxonomy called series. If I view any post and that post belongs term Banana it should list all the posts in term Banana in a dropdown list. Here's the ...
0
votes
0answers
21 views

Auto create child post from custom field?

I have a custom post type that has 3 custom fields. If I create a post with data filled in those 3 custom fields I want it to auto create child posts for each custom field & using the data from ...
0
votes
1answer
39 views

Wrong post title displayed from loop

I'm building my own theme. I have a page set for my blog (with a template that I made) which I'd like to just display a few of my posts. It uses the following loop: <?php ...
0
votes
0answers
49 views

Advanced Custom Fields shows all posts

My ACF plugin shall only show posts with my organisation type = socialbusiness. Somehow it doesn't even care about my meta_query, it also doesn't care about the categories I selected (it shows "blog" ...
0
votes
1answer
40 views

2 queries with counters

I have 2 loops on a page both containing a counter to implement slightly different code every 6 posts. For some reason though the second loop is implementing the different code sometimes after 4 items ...
-1
votes
2answers
155 views

query_posts different amount of posts per page

I have a posts_per_page query to paginate multiple post types, which works great! Now though, as it paginates it to show (in this case) 100 posts per page, I'm wondering if you can show 100 on page ...
0
votes
1answer
32 views

Query all post types but limit to parents

I'm building a site with several post types and am using a single index.php to query the archive for each one in turn. One of these post types is hierarchical and I'd like to just query the parent. I ...
0
votes
1answer
77 views

post_parent array doesn't work

I have a problem. I created a shortcode to show a galerie. I used query_posts to fetch all posts of a parent post and get the data from there: function galerie_baureihe() { $parent_id = ...
0
votes
1answer
12 views

get “read more” with custom DB query like you would with WP Query

I am using a custom database query to fetch posts. In the post I have a break tag, which is displayed as <!--more--> in the database wp_posts table, but I can't get it to output like I would if ...
1
vote
2answers
103 views

List posts in alphabetical order

What I'm trying to achieve is to set the list shown in alphabetical order. Any thoughts on how i can successfully achieve this? I have pasted the snippet below for reference. <ul ...
-1
votes
1answer
99 views

limit number of post for achive page

Im trying to limit the number of post for my archive page, in a specific category. I've manage to display post from just the category I desire, However, if i setup a loop to limit the number of ...
-1
votes
1answer
72 views

Create “archives by year and week” by category template

I'm trying to figure out a problem quite tuff; I explain myself; I have my pages ( which are in fact a category template). I take for example this website: http://www.irishpost.co.uk/ Where the ...
0
votes
0answers
35 views

Sorting with custom field and 'comment_count' - orderby

How can I also add comment_count to my existing query? Below query works fine and sorts the archive with highest rating_avg only, I would like to sort my archive using rating_avg first and then the ...