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
6 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
11 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
30 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
34 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
18 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
31 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
26 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
67 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
19 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
35 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
21 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 ...
0
votes
1answer
53 views

Get posts by category or author

I want to get posts from a particular category or if the post by a particular user . It seems we could only have AND condition in wordpress . I know the below code is wrong but this is what I need to ...
0
votes
2answers
37 views

WP_Query Posts by Metadata from Option Tree

I am doing a WP_Query trying to filter out the posts by Metadata. $args = array( 'ignore_sticky_posts'=> 1, 'post_type' => 'post_projects', 'post_status' => 'publish', ...
0
votes
0answers
25 views

Use one column per category

I dont typically do wordpress development, though I am a PHP developer, so I get those concepts. I apologize if this has been asked and answered already. I looked through the questions as they ...
1
vote
1answer
17 views

Display custom tags on pages that have a specific page parent

I would like to use Using the WP_Query or Query_Posts method. I'm currently using the query_post method. $terms_array = array(); if ($strurl == "somesite.com"){ $resparent = "18219"; //Page ID ...
0
votes
1answer
20 views

Best way to create a search for custom post type by custom field values

I have a custom post type called people. I want to have 3 search fields for; first-name, middle-name and last-name I was thinking about creating a page with my own search boxes and use query_posts: ...
0
votes
0answers
29 views

Pagination on page.php with wp_query and query_posts

I'm trying to get pagination to work on a custom page.php and this has been kicking my butt... here is my site Here is my code: <!-- Page Blog Body Start ...
0
votes
0answers
12 views

Show different content in the same URL

I have a blog powered by Wordpress. I need to show different contents in a same webpage according to the date. Say I have few posts with the url format: domain.com/post-01022015, ...
0
votes
1answer
23 views

Dynamic category name in query post

I want to make the following query_posts to use the current page's category name. For example, the user is located at: examplesite.com/category/apples/, and i want to use "apples" and for a different ...
0
votes
0answers
45 views

How to query and group posts by category?

/* * Loop through Categories and Display Posts within */ $post_type = 'post'; // Get all the taxonomies for this post type $taxonomies = get_object_taxonomies( array( ...
0
votes
1answer
16 views

Sort / Filter Queries

I'm working on a website, that showcases products, and now I'm working on the query part. Basically I want to have one page, that displays a list of products as a normal query, and then on top of the ...
1
vote
1answer
21 views

Modify theme to get page excerpts on front page

I am trying to modify this theme so that the Latest News section shows excerpts from 3 specific pages (for example, /page1, /page2, /page3) instead of 3 most recent posts. This is the relevant code ...
0
votes
1answer
30 views

Counter is skipping post when I still want it visible [closed]

I am showing the 5 latest posts on my homepage. I am using a count so that on the 3rd post it shows a div which will be completely seperate to the blog posts. However rather than the 3rd post ...
0
votes
0answers
21 views

Infinite scoll on search page not working

i have implemented infinite scroll feature to my custom wordpress theme which is working fine on home/index page but i search page of my theme the infinite scroll is not working properly. The Problem ...
0
votes
1answer
37 views

Reset Wordpress Post Query to default

i am in a situation, i am creating a custom wordpress theme but i am stuck over something. in my index/home page, firstly i am displaying 6 posts by category like below <?php $posts = ...
0
votes
1answer
29 views

get_page_by_title() not working if special characters are present

get_page_by_title works fine on plain text title. but when it comes to smart quotes and symbols like # it doesn't work. It fails to find post with the given title. For Example:- ...
0
votes
2answers
101 views

Custom search SQL Query to add custom field in result

I have to write my own MySQL query since I haven't found a good way to do it within wordpress functionality. I want the search query to search trough post_title / post_content & meta_key ...
0
votes
1answer
28 views

Modify WordPress loop after it has been run

I am trying to build a category page that displays 8 posts from the category, but when the user clicks on "Read More" (which does an Ajax request and displays more posts), I would like the loop to ...
2
votes
2answers
84 views

How to ensure that is_search() return false after query_posts

I know I am not supposed to use query_posts The thing is I have a program that already do that. query_posts(""); echo "is_search():" . is_search(); query_posts("s=kucing"); echo "is_search after():" ...
0
votes
0answers
10 views

alter $post variable in main query as soon as possible [duplicate]

I'm using WP with WooCommerce. For some purpose, I want to load a predefined static page (e.g. with id=5) whenever the user enters a product page (e.g. www.mysite.com/?product=my-product), by ...
0
votes
2answers
42 views

query_posts adding extra code to homepage

I've made a custom post type "brands". I have a custom template that display's these brands on this page: http://www.southernms.com/new/brands/ I also want these brands added to the homepage. So I am ...
0
votes
0answers
62 views

pre_get_post alter current post id

For some purpose, we want to apply a change to the Wordpress flow that affect's WooCommerce product page being displayed. When a product page is displayed (e.g. www.mysite.com/?product=my-product), ...
0
votes
1answer
49 views

Multiple search queries on one page

I need to display results of three different search queries on one page. More precisely, there is a searchbox on my page where a user enters a search phrase. Once the search phrase is submitted, I ...
0
votes
0answers
51 views

Some posts appear in duplicate with paginated query

I'm querying a custom post type with some custom post meta, and then output the results. This is the query: $paged = (get_query_var('paged')) ? get_query_var('paged') : 1; $properties_query = array( ...
0
votes
0answers
37 views

How can I make Pagination Work on a WordPress Static Front Page

I have this pagination function I have been using on traditional post listing pages. But on my home page I have a section where I have post listings and I want to paginate them but it is not working. ...
0
votes
1answer
45 views

Query Products & Store IDs in array

I'm attempting to query Products in WooCommerce and return their IDs as an array that can be used to filter conditionally. I'm using ACF Pro to add custom fields into the product, for which I'm then ...
4
votes
2answers
123 views

Query Multiple Post types each with own meta query

I have 2 post types: lets say products and product_variations. I'd like to be able to modify the query via pre_get_posts to get all product with meta_keys "_visible" = "true" and "_available" = "true" ...
0
votes
2answers
43 views

Creating attachments archive in tags and categories

Per this question (How to create an attachments archive with working pagination?), I've been using the following function to have archive pages display attachments as well as pages and posts. It was ...
0
votes
0answers
14 views

Get the page that have particular value in advanced custom field

All my pages have advanced custom field called : “Program slug” I would like to get link to the page that have particular value in that custom field. For example : Want to get link to the page that ...
0
votes
1answer
27 views

Query post only from categories that have subcategories

My categories structure : Category 1 (8 Posts ) subcategory1 (2 Posts) subcategory2 (2 Posts) subcategory3 (2 Posts) Category 2 (6 Posts) subcategory1 (2 Posts) subcategory2 (2 Posts) ...
0
votes
1answer
60 views

Custome column sort by date not title

I've created a custom column. Currently they are automatically sorting by title however i want them to sort by date. I've tried adding a "query_post" like: ...
0
votes
1answer
39 views

How to use 'WP_Query' or 'query_posts' to display content in a descending order

How can I list posts in a descending order of the $json_data->data[0]->total_count values ? I want to display top shared posts descending, but I can't really use WP_Query or query_posts the ...
0
votes
0answers
29 views

Menu not showing while using filter hook for custom posts

I have a custom post type named event and each event has a meta value named event_date. event post type has two custom taxonomy event_category and event_location. On the homepage I'm trying to show ...
0
votes
0answers
61 views

How can I add recent posts to menu like mashable

I would like create a mega menu that uses recent posts for hover state. Like When you hover a submenu you get a list of recent post relevant to that menu item like in Mashable. I I would like a menu ...
0
votes
1answer
138 views

Display post list within category list sorted by name [duplicate]

I'm trying to display a list of categories sorted by name and all posts of each category inside it. Like this: Category A Post B Post F Post Z Category B Post A Post C Post G Category C Post D ...
0
votes
1answer
39 views

Way to cache a query for 24 hrs

Would like to show a random tip from tips category in wordpress and change it every 24hrs... is it possible? Here is my query // Random post link function randomPostlink(){ $RandPostQuery = new ...
0
votes
1answer
73 views

Display only one post each WEEK

I have custom post type named 'NEWS' where i already published 52 posts at a time. Now, in front i would like to display them ONE NEWS for ONE WEEK. So 52 NEWS will cover one year for me. My ...
0
votes
0answers
7 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
51 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
20 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 ...