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
9 views

Problem pagination - infinite js

I follow this Tutorial : Tutorial infinite scroll - Wordpress When load page 2 , i have same content with page 1. It did not load next posts . I dont know why, i think something was wrong with : ...
0
votes
1answer
23 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
32 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
17 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
22 views

Append post link via jQuery [closed]

In an effort to get a nice, transitioning post filter I downloaded the Quicksand jQuery Post Filter and changed the code to match my desires, amongst others I added post content, changed layout 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
15 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
0answers
17 views

Query for showing posts where the gallery custom field, ACF gallery custom field plugin, is not empty [closed]

I'm using the gallery add-on for advanced custom fields wordpress plugin to add images to individual posts which I then display as a gallery using liquid slider. On a single post page I display the ...
0
votes
1answer
52 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
47 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
42 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
44 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
21 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
35 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
31 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
95 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
21 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
31 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
58 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
46 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
26 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
30 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
48 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
14 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
38 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
57 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
22 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
24 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
31 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
27 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
42 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
34 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
140 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
31 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
93 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
54 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
85 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
62 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
61 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
42 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
60 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
135 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
105 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
17 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
36 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
73 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
43 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 ...