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
1answer
44 views

Meta Query with date and time on the same Day before given time

I have a metaquery for a custom post type "events". Their start date is stored as a meta field in this format: 2016-02-05 19:00:00 These are my query args: $args = array( "posts_per_page" ...
0
votes
2answers
26 views

ACF Custom Field WP_Query, but need to get all posts, if field doesn't exist

I have a custom ACF field set on all posts, called event_date, I would like to grab all posts within a given category, but have posts that have event_date defined put first in DESC order of ...
0
votes
1answer
23 views

Get Post content in another file?

I am working on a plugin .I have a custom post type team.Custom post has four posts of different categories.I used this code to send post id of each using ajax. $(document).ready(function () { ...
1
vote
0answers
15 views

Random ajax load only works with posts_per_page set to -1

I created a post loader shortcode, that uses AJAX to load posts. Even though I can set the order and order_by query parameters, the order_by should be random. From what I've seen on the web, ajax load ...
0
votes
1answer
14 views

How to order by datediff in WP loop?

I have a custom post type for events with a custom field named event_start_date, and I want to sort the archive loop according to the nearest event_start_date. In other words, the event with the ...
1
vote
0answers
12 views

Homepage's content is dependent on the custom field values (set automatically), how do I get homepage to update without manually updating page?

I have a custom field in my home page called "Featured posts". There are two fields: title and post. The post field returns post_object with post_type as posts. In my functions.php I have added the ...
-3
votes
0answers
16 views

Swapping ?orderby=title href on click or if active

I have a list of posts with multiple orderby buttons. I would like the buttons once clicked to then sort the posts in the reverse order. For instance I currently have: <a ...
0
votes
1answer
33 views

Query posts based on the meta key values of logged-in users?

I searched in WordPress Codes, and all of the online forums and tutorials about this but could not find any relevant solution. What I am trying to achieve is to create a query that lists posts for a ...
0
votes
1answer
19 views

Dynamic archive of posts by date

I'm currently working on an intranet site for a big company and based on the project description, there will be a lot of articles posted everyday so this website will need various archive pages with ...
0
votes
4answers
33 views

wp_posts table: safely remove unused columns to save database storage

i search about it on google but didn't find any thing. I want to remove my wordpress wp_posts table's unused columns, to save my database storage... I know if table column is empty it will not ...
0
votes
0answers
17 views

Query Database for URL

I have a multisite setup and was wondering how I can query a database to find and retrieve a URL if it exists, otherwise, don't output anything... For example, using the two following domains which ...
0
votes
1answer
26 views

All categories displays the same posts

Googled for hours and couldn't find solution anywhere. =) This solution doesn't work as well: Display all posts in current category Regardless of how I alter my query_posts - it always displays all ...
0
votes
1answer
41 views

query_posts by category_name and custom taxonomy

I want to display posts filtered by category_name and custom taxonomy-term: I have function channel_init() { // create a new taxonomy register_taxonomy( 'channel', 'post', array( ...
0
votes
1answer
25 views

Pagination, query more pages at once

I'm wondering if it is possible to do such thing on Wordpress, I have an infinite scroll to display my posts, I'm keeping track the pages updating the url: mypage.com/news/?pag=3 and I have a code ...
0
votes
0answers
27 views

WP tag slug name in URL

I want display tags from specify category. My code is: $query_args = array( 'category__in' => $category->term_id , 'posts_per_page' => -1 ) $query = new WP_Query( $query_args ); ...
0
votes
0answers
34 views

Imported Content Doesnt Show Up On Frontend

I found similar problems posted couple times, for different custom post types, but none of the solutions worked for me and these, other questions, didnt have much info provided, I'll try to give as ...
0
votes
2answers
42 views

how to repeat taxonomy in different places on wordpress

I need help with this. I need repeat taxonomy in two places, are post, and coupones post, this code is in clipper theme. this code put taxonomy stores in coupon. add_action('init', 'clpr_post_type', ...
0
votes
1answer
61 views

Archive for custom taxonomy lists all posts instead of current taxonomy

I'm using the Types plugin for a custom post type "Session", which has the custom taxonomy "Semester". I would now like to create an archive page for each semester which is automatically generated. ...
0
votes
1answer
22 views

how to exclude store in clipper theme wordpress code php

I need your help, I have exlude store in clipper theme how can I do. my code is not working, please help $cat_related = query_posts( array( 'post_type' => APP_POST_TYPE, 'post_status' ...
0
votes
1answer
45 views

Randomly load categories with latest post

I am creating a slider that loads 5 different categories. The categories are randomly loaded into the page. So I know the id's of the categories and they are loaded random to the page. What I want to ...
0
votes
0answers
8 views

How can I add a search input for every column in manage posts?

I am attempting to make it so that I can compare inputs to individual post variables. I can't seem to get this to work though. I have a filter for manage_lead_posts_columns (lead is my post type), ...
0
votes
0answers
35 views

Adding custom fields multi value using json-api

I'm using json-api to create a post with custom fields using query: ...
0
votes
1answer
36 views

How to reverse post navigation at bottom of post

I am using a child theme derived from twentythirteen. I wanted to have my posts displayed in chronological order(ascending). I tried adding the code from this answer to index.php but for some reason ...
0
votes
0answers
24 views

Can I Use Query_Posts() For Dynamic Filtering?

The Codex page for Query_posts() basically says "don't use query_posts". However, I have tried all of the alternatives they suggest, as well as methods from other sources, and I have had no luck. ...
0
votes
0answers
14 views

Making sure to always display posts from three different authors

Say I want to display nine posts on my homepage, and have 3 authors on the blog. Using WP_Query or a similar method, Is it possible to make sure that at least 1 or 2 posts from each author is ...
-1
votes
2answers
46 views

query_posts works while get_posts doesn't

I try to create a page that shows my posts (a page different than the "posts page" defined in wp-admin). When I copy my index.php into this new page and add <?php ...
0
votes
3answers
69 views

Sort by custom field is not working

I have a custom query: <?php query_posts(array( 'post_type' => 'properties', 'meta_key' => 'pd_city', 'orderby' => 'meta_value', 'order' => 'ASC', 'posts_per_page' => 5, 'paged' ...
1
vote
0answers
25 views

How to get Related Custom Posts?

So i am having an issue where i try to get the latest posts but also the related one from Custom Post Format - Video. Didnt see anywhere this solution/tut, is it even possible, i guess it is. I just ...
0
votes
1answer
60 views

Posts - display all posts except a post by an ID

I want to be able to display all posts except a the most recent post which I am doing as follows:- $last = wp_get_recent_posts( '1'); $last_id = $last['0']['ID']; echo $last_id; //1477 $args = ...
0
votes
0answers
26 views

Ordering Posts by parent category, name ascending

I am currently creating a theme, and I have 2 parent categories: Budget and Brand. On home.php, I want to order all the posts ascending by their sub category name without showing the category title. ...
0
votes
1answer
80 views

Query posts by specific word on title

Is it possible to query posts by a specific word on title? Example: I have 3 posts inside my blog and only two have the word car on the title. She wants a ride on my truck My car is super fast ...
-2
votes
1answer
45 views

How much worse is querying custom fields compared to custom taxonomies, quantitatively

OK, I know (because i've read it many times) why custom fields is less efficient than custom taxonomies when it comes to querying/filtering posts, but just how inefficient is it by comparison? I'd ...
0
votes
0answers
25 views

Search on Category and BETWEEN custom meta field

Background I am building simple car theme where I want to review cars, however, I'm really struggling with my search implementation. I have added a couple of custom meta fields to the post including ...
0
votes
1answer
33 views

Optimise custom post type queries

Not sure whether this one has been covered before - I certainly couldn't find anything relevant. I am developing a fairly decent sized photography site which utilises a few different custom post ...
0
votes
0answers
61 views

Used with meta_query in query_posts works slowly

Hey i have a problem this my code and if i used with all parameters i get from $_GET its start work so slowly..... (like 5 min). $checkbox = array( 'immediate'=>'כניסה מידית', ...
0
votes
1answer
85 views

Single meta key with multiple meta value in like comparison

How can I search posts with single meta key but possible multiple meta value in like comparison. Here is my array for query post. Array( [post_type] => post [posts_per_page] => 3 ...
0
votes
0answers
30 views

Cannot Get Title or Thumbnail of Posts Page

I set up a page called 'News' and applied this as my posts page. I am really struggling, however, to output the title 'News' or the featured image that has been added to the page itself. Whenever I ...
1
vote
1answer
115 views

get_post_meta causes database queries

I want to know why my site's search results are slow. I've used the excellent Debug Bar plugin, and found out that each search result causes 5 DB queries, of which 3 are SELECT meta_key (see below for ...
0
votes
1answer
229 views

Example Query Posts Showing the Latest Post with the Featured Image

I have seen the answer on Stack Overflow, "Example Query Posts Showing the Latest Post with the Featured Image". query_posts( 'showposts=1' ); while ( have_posts() ) : the_post(); ?><h3 ...
0
votes
0answers
34 views

Need help writing loop to display posts by categories in separate divs

Total newb to WP codex. Below is what I'm attempting (the comments describe what I want the loop to do). Thanks in advance for your help! <!-- if there are posts in category slug A, show div below ...
0
votes
1answer
127 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
0answers
373 views

How to display most popular post by views count in WordPress?

I tried to display the most view post in last 30 days in my WP page, how to do this? What I did is: <div>Most Read Blog Posts Over Past 30 Days</div> ...
0
votes
1answer
31 views

How to limit the number of posts a user can view based on status

I would like to create the subscriber system with the following status for the user: active and pending. So, for the pending status user only can read 3 articles for free. I created using php file and ...
0
votes
0answers
33 views

How to search posts by title, id and author? [duplicate]

i am getting the details from a custom search with the below query from a parameter $_REQUEST['search'] in the URL $custom_args = array( 'post_type' => 'post', 'posts_per_page' => 5, ...
0
votes
0answers
90 views

How to add number of post to category menu items

I wanted to know how we can add number of posts for dropdown menu items that are categories. For example: Topics Category 1 (5) Category 2 (8) Category 3 (2) More Topics Category 1 (5) ...
0
votes
1answer
106 views

Query Posts by Custom Field

I'm looking to query my posts via a custom field that I've created on my page. But the custom field is an array of values. So the custom field 'country' could look like this country => ...
0
votes
1answer
648 views

WP-API: get posts in multiple categories

Let's say, I have two categories, 'color' and 'temperature'. Each one has a number of sub-categories. Wordpress does great job displaying posts in requested categories when I go to URL like this one: ...
0
votes
1answer
84 views

query_posts with meta_value

I have category 'news' http://localhost/foldername/news, for each 'news' posts I have custom field called 'years' and is set up as a Text Field. I have 2 values assigned n different posts '2013' and ...
0
votes
1answer
91 views

How exclude 3 latest posts of a category in query_posts

I am newbie in wordpress development, and usually I use query posts with simple commands. I have a slider in home page which shows 3 latest posts form 'featured' category. I have also a news box ...
0
votes
1answer
77 views

Multiple loops without repeating content

I have a second loop on a page where I want to display posts from the same category as the present post but excluding the present post. I have a loop that displays all the posts from the same ...