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

3
votes
1answer
309 views

Query posts: how to exclude results if post is in multiple categories

Say I have 3 categories: A, B, C, and another category D that posts in A,B,C can also be assigned to. D is to denote the featured post for the category, and theoretically only one post for each (A, ...
2
votes
1answer
37 views

How do I query for a post by custom field?

I have a custom field called "song-id" and I'd like to lookup a post by a song-id value. Can someone give me the code snippet for it? (bonus: also looking for a code to use the permalink in the post ...
2
votes
0answers
49 views

WordPress query for most recent posts from multiple categories

I have 5 categories. I want to query each category and get a list of the most recent posts from them. I also only want single post from each category, with no duplicates. Is there a way to do this ...
2
votes
0answers
1k views

query_posts with a custom post type, a meta_query and sorting by post date?

I've searched the archives and found questions similar to what I need, but haven't found exactly what I want. I've got a bunch of products that are sorted by a meta_key of country, and I'd like to be ...
1
vote
0answers
59 views

BBPress Search results in Wordpress search

I want to display in Wordpress search results page - 10 or less found results from BBPress (plugin) forums. I know that BBPress use custom post types (forum, topic, reply) but I don't know how to do ...
1
vote
0answers
91 views

How to increase load time of an archive/search page (WP_Query)

I'm currently looking at why the archive and search pages take so long to use, and have found that the bulk of processing time is spent on the query_posts that is called before the template has even ...
1
vote
0answers
182 views

Listing all term items alphabetically / sorting loop

I have my own custom post type and it has its own taxonomy and terms. Whenever user visits http://example.com/mytaxonomy/myterm I want the page to display all items within this term alphabetically. ...
1
vote
0answers
27 views

Simple custom post query for all the posts or many of them not working

I am doing this query $args = array( 'posts_per_page' => '-1', 'post_type' => 'custom_post_type', 'post_status' => 'publish' ); query_posts( $args ); but it is not working I have around ...
1
vote
0answers
202 views

Querying posts with meta value that begins with a certain pattern

I am trying to create a search filter using meta_query. The only problem I'm having now is that I can't compare with wildcards. I think that's how you word it? $keyword = 'sos'; $tlds = ...
1
vote
0answers
263 views

List Posts For Terms Of A Custom Taxonomy For Any Post Type

The function is great and i am using this function with these filter to just display selected taxonomy term posts by id, but what result i am getting is like this Child Taxonomy 1 - Child Taxonomy 1 ...
1
vote
0answers
218 views

define orderby URL with meta_key=post_views_count

I want to make an url with meta_key=post_views_count. E.g: http://www.mysampleweb.com/?meta_key=post_views_count&orderby=meta_value&order=DESC So the posts should be ordered by Views. ...
1
vote
0answers
330 views

filter custom field values $min $max

The user needs to query posts by entering a $minPrice, $maxPrice and a category value. Here is my query which returns no results: function result() { $result = array( 'cat' => ...
1
vote
0answers
255 views

Query_posts and attachments

I need some guidance on some WP code. I'm wondering if it's possible to take this code (which is grabbing all the images from the posts across my site and dumping them out): $args = array( ...
1
vote
0answers
114 views

Order by category titles

I have a category page called 'features' this is all fine, but the posts in the features category also belong to a certain genre of film, and it's this what I want to order the posts by on the actual ...
0
votes
0answers
11 views

How to modify WP_Query outside the loop?

I am running a WP_Query which shows some posts and the posts are added into an array of Object. How can I modify the array of Object outside the loop. My Code is: $original_blog_id = ...
0
votes
0answers
7 views

Can display previous post with or without wp_pagenavi

I use Wordpress with the free version of Pageline platform theme. I figured out that the "previous/next entries" links are displayed on the main page but not on my others static pages. I tried to use ...
0
votes
0answers
54 views

Pagination not working on template page

I have the following code, but it is not working. if ( get_query_var('paged') ) { $paged = get_query_var('paged'); } elseif ( get_query_var('page') ) { $paged = ...
0
votes
0answers
23 views

Global post is always custom post type last post

my global $post is always taking the object of my custom post type "advertisement". So when i'm editing e.g. "Hello world" which post id is 1, it shows me post id of the last advertisement post. If ...
0
votes
0answers
36 views

Polylang fallback language does not get activated even with patch

<?php //my patched archive.php to display posts of a category get_header(); ?> <div id="content"> <?php global $wp_query; ...
0
votes
0answers
55 views

Post per page not working

I have 2 parent categories are app and game. Beside them has child categories. My code get 6 post from 2 parent categories with orderby post date and order DESC, but post per page not working. Please ...
0
votes
0answers
20 views

Query Posts oder by Date

my query does not work as it should. This is my Code: wp_reset_query(); $paged = (get_query_var('paged')) ? get_query_var('paged') : 1; $args = array( 'post_type' => 'post', ...
0
votes
0answers
132 views

Display newest posts from multiple categories ordered by date

I have the categories listed below in my post post type. Category Name: Test 1 ID: 1 Category Name: Test 2 ID: 2 Category Name: Test 3 ID: 3 Category Name: Test 4 ID: 4 I'd like to retrieve for ...
0
votes
0answers
81 views

url_to_postid redirected posts

i wanna url_to_postid some urls, it work pretty fine but when it come to auto-redirected posts it fail to return postid. here is my example urls: http://animup.net/anime/kuroko-no-basket-2/ auto ...
0
votes
0answers
88 views

why is pre_get_posts not working

function include_category( $query ) { if ( $query->is_home() && $query->is_main_query() ) { $query->set( 'cat', '3' ); } } add_action( 'pre_get_posts', 'include_category' ); I ...
0
votes
0answers
161 views

Query Posts From Multiple Post Types

Is there an easier or more efficient way of querying posts from multiple post types by the date of which they were published? I read this question here: Using Query Posts With Multiple Post Types And ...
0
votes
0answers
29 views

Array in POST request -> is 404

I send array in post request <form action='<?php echo get_permalink(); ?>' method='POST'> <input type="hidden" name="question[]" value="<?php echo $question->ID ?>"> ...
0
votes
0answers
68 views

Join two wp_query

So, i have custom posts with this settings: Example 1: have meta_key "price" Example 2: have meta_key "no_price" So, i want to list this posts ordered by "price". I just want to join these two wp ...
0
votes
0answers
38 views

Joining column from table to query_posts

This is more of a question to be sure that I am on the right track with how I want to do this. I am using a custom template that uses elements of theme to display products based on filter results. I ...
0
votes
0answers
27 views

use more than one meta key in query using posts_where

Here I want to add query for more then one meta key as here: $where .= " AND meta_key='order_assign_delivery_date' AND meta_value LIKE '0000%' And meta_key='order_assign_data' AND meta_value=0"; so ...
0
votes
0answers
167 views

Add a DropDown Taxonomy Filter on Archive Page

I need to add a taxonomy dropdwon filter in archive page so that I can display the posts assigned to selected taxonomy. Here is the HTML Output for taxonomies: <form method="post" ...
0
votes
0answers
11 views

How to show specific tagged posts and ordered by future date on the homepage

I'm creating a site that has upcoming shows on the homepage. I would like the future shows that are up next to show on the home page. I have created a custom field on the posts called "show_date" with ...
0
votes
0answers
178 views

Converting an existing query_posts to WP_Query

I am having trouble trying to convert my query_posts loop that is bugging out to a WP_Query, was hoping someone may have some luck looking at it: This is my old loop: <article ...
0
votes
0answers
48 views

Show post when both categories are present but not one of them

I'm having issue filtering posts by category. There is the A category for posts (which is the default and also applies when no category has been set explicitly) and B category with subcategories for ...
0
votes
0answers
31 views

Limit posts displayed to 2 specific posts

I'm using the Twenty Twelve theme. I have created a basic page. What I want to do is keep 2 only posts (that I select) on the page at all times. In looking at the code I think this is the section that ...
0
votes
0answers
36 views

Posts from current category on custom page

I have a problem - I want display posts from current category on page with custom template. I write something like this: <?php include 'header.php' ?> <div class='content'> ...
0
votes
0answers
41 views

Custom Fields & Posts

I've got one template, which I use on many different pages. The problem is that I want to show different posts according to their "pagename" category. Ex. "About" is going to show "About category" ...
0
votes
0answers
107 views

Post Filter clearing on pagination $_post

I have a form, in which users can select what taxonomy they want the posts filtered by. It works fine except that it doesn't paginate. When I click on the next page of results, it clears the query. ...
0
votes
0answers
223 views

Variable Posts per Page function plus pagination not working

I use the Reverie theme as a framework for my sites and I'm having an issue with using a function to create variable posts per page plus having the arrows for the paging to work. I used the variable ...
0
votes
0answers
36 views

Dynamic Custom Tax Archive Page?

Is it possible to have a page that dynamically shows a range of categories/custom taxonomies along with their posts? Category 1 - Post from above cat - Post from above cat - Post from above cat ...
0
votes
0answers
47 views

how to prevent words inside image tags from being update in a sql query via php

I need to update certain words inside wp_posts table (1032 posts in a specific time range) but I would like to exclude some words when they are inside tags like so: <img ...
0
votes
0answers
62 views

WP Build-In Post selector for CPT

I'm quite sure to remember any WP build-in function that generates post selector based on several args (post_type, etc.) like on the nav-menus admin page, here a screenshot: Is there something like ...
0
votes
0answers
180 views

Advanced Custom Fields Post Object

I am looking to create a custom proposal system with WP and ACF. I created 3 custom post types. Proposal Objectives Proposal Items Proposals I created some custom fields in ACF to include in ...
0
votes
0answers
194 views

Turning wp list categories into a dropdown menu

I am creating a custom dropdown for my wp site and I am running into issues. I have a taxonomy set up called 'types', these can be filtered in a nav at the top of the page and they link to the right ...
0
votes
0answers
119 views

Listing Subcategories with post titles underneath

When viewing a parent category page, I am trying to list its sub-categories with each post title (max 5) underneath. I have managed to put together a code that lists sub category titles and I have ...
0
votes
0answers
284 views

Filter posts by multiple checkbox categories

I would like to set up a widget to filter my post by categories. Let's say, I do have two different categories, "Countries" and "length of stay" with sub categories. Here is an example of what I have: ...
0
votes
0answers
28 views

complete show post older 10 post

i want show random post older 10 post i used this code for show 5 random post <?php $args = array( 'numberposts' => 5, 'orderby' => 'rand' ); $rand_posts = get_posts( $args ); foreach( ...
0
votes
0answers
43 views

Displaying posts by year

I'm trying to display posts on the homepage from the current year only. I am using the following: <?php if ( is_front_page()) { ?> <?php $current_year = date('Y'); ?> <?php ...
0
votes
0answers
49 views

Combining Custom Tax Conditionals and Custom Querys?

The following has a custom post type of features, within that a custom tax called feature-type with three categories, template-1, template-2 and template-3. Each custom post feature needs to select ...
0
votes
0answers
44 views

Pagination for blocks with custom post_queries

I tried many of pagination functions but no one is working good. They all display page count and link to page but when I click on the link no result. Nothing is changed except browser's adress link. ...
-1
votes
0answers
14 views

Suggested posts from categories

I need a certain procedure to display suggested/similar posts for each post, but I've never done something like this, so I'd ask for some guidance: Take all the categories the current post belongs ...