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

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 ...
1
vote
1answer
43 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
26 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
74 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
21 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
29 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
142 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
28 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
59 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
82 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
53 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
154 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
29 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
52 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
59 views

Adding custom fields multi value using json-api

I'm using json-api to create a post with custom fields using query: http://example.com/api/posts/create_post/?type=event&nonce=a455dcc4ea&title=test%20title&status=publish&...
0
votes
1answer
100 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
27 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
16 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
81 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 query_posts('post_type=post&...
0
votes
3answers
141 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
28 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
137 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
58 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
126 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
52 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
54 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
40 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
88 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'=>'כניסה מידית', 'air'=>'...
0
votes
1answer
126 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
35 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
198 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
480 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
39 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
251 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
514 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
37 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
164 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
147 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 => usa,africa,...
0
votes
1answer
1k 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
116 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
156 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
126 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 ...
0
votes
1answer
52 views

Make tag archive display post are ordered by post format

I would like to set up an archive page for tags where posts are displayed separated depending on post format, first post-format-aside then an archive with all posts except the posts already displayed, ...
1
vote
1answer
49 views

Post Rank on Single Post page based on custom field

As per my previous question. How to show posts rank based on custom field value It works perfect on homepage as I wanted. Now I want to show the same rank in single post pages also.
-2
votes
2answers
563 views

How to get Custom post type by related category ID

I have created a custom post types in function.php file. I has created 4 categories on Service menu section, aa, bb, cc and dd, I try to get a latest 5 post for specific category but I can archive ...
0
votes
1answer
31 views

Inserting two categories

I am trying to define two categories together in a post. please tell me where i am doing wrong. 'post_author' => $user_id, 'post_status' => 'pending', '...
0
votes
2answers
45 views

No duplicate tags by category

I have script to show list tags from category and works very well. <ul class="inline-list"> <?php query_posts('category_name=lain-lain'); if (...
0
votes
0answers
101 views

How to achieve an elegant way when using ajax to get data for a table in WordPress?

I'm working on the update for a website which wasn't originally developed by me. The task is to have a table on a main page and, if you move a slider with value on it (100, 200, ... 1000), the table ...