"wp-query" ambiguously refers to one of two things. 1) WP_Query is a class native to Wordpress which allows users to query the posts database using a number of criteria. 2) $wp_query is the default object that holds the main query object on each WordPress page.

learn more… | top users | synonyms

0
votes
0answers
30 views

Change sort order when using 'orderby' => 'type'

When doing a wp_query with the following parameters: $arg = array( 'post_type' => array( 'activity', 'publication', 'project', 'course' ), 'order' => 'ASC', 'orderby' => 'type', ...
0
votes
3answers
40 views

How to output the title of the blogs home page

I am using a static frontpage and a page for my blogposts. In my header.php I want to display the title of the selected page of my blogposts. For example: <?php if( is_home() ) echo ...
0
votes
0answers
37 views

Wordpress loop uses unmodified posts array, why?

I have this code in a Wordpress template: $prepost = $post; $normal_args = array( // here goes the args ); $normal_query = new WP_Query( $normal_args ); echo 'BEFORE: ' . ...
2
votes
1answer
49 views

Make loop display posts by alphabetical order

With this loop I am displaying single posts on an archive page. The posts are being sorted by the category 'Banks'. In addition to that, how can I display them in alphabetical order? I've tried using ...
0
votes
1answer
27 views

Display the current post in browser as the first post in a loop (for a slideshow)

I have a custom post type - on a single page it displays all kinds of information for the post type. There are 10 posts altogether. Below the info I have a slideshow as part of a loop that displays ...
1
vote
1answer
54 views

How can I retrieve comments from last 5 minutes for a post?

I need to find comments posted in last 5 minutes. I am using the following query. What should be the value of before? <?php $postID = get_the_ID(); wp_list_comments(array( ...
0
votes
2answers
61 views

Inserting HTML to close and open divs in WP_Query loops

The output I am trying to achieve is this: <div class="row"> <div class="small-1 large-4 columns"><a href="some link"><img src="some image"></a></div> <div ...
1
vote
0answers
41 views

inserting a post from an extern php file but post content doesn't show on wp site

I'm doing a php file that insert post's on my wordpress site. I'm filling all the fields in wp_posts, but the content doesn't shows on my wordpress site. I wonder if it's because the categories are ...
1
vote
1answer
27 views

Exclude current post when getting related post on custom post type and taxonomy

The below will return the other post in the same category but it will also return the current post too. Is there a way to exclude the current post from the query? $args = array( 'post_type' ...
3
votes
2answers
128 views

How do I reorder (pop and push) items from WP_Query?

I have this piece of code: $normal_args = array( 'order' => 'desc', 'ignore_sticky_posts' => 1, 'meta_query' => array( array( 'key' ...
1
vote
1answer
32 views

Get the last month with posts using a recursive function…

There is probably another way but I would like to understand why this code returns null... I only have posts in october and here's the recursive function: function last_post( $month,$year ) { ...
0
votes
0answers
36 views

Search by attributes or taxonomy

I'm trying to filter products by taxonomy or attributes, but I think the function has something wrong: global $woocommerce, $woocommerce_loop; $attribute = 'color-de-piel'; $values = 'Blanca'; ...
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
1answer
53 views

A faster way to query custom post types with multiple conditions?

I am using a lot of custom post types (CPTs) with custom meta and so far I have been using queries like the below, to get for example all events in CountryX that happened in 2014: <?php global ...
0
votes
1answer
72 views

Querying posts with meta key and meta value not returning anything

I'm trying to create a query returning pages with a certain meta value. Only using meta_key works, it just doesn't work when I use both meta_key and meta_value. I know the meta_value is correct - I ...
0
votes
1answer
40 views

Order a WP_Query by meta value where the value is an array

I have a WordPress custom query: $args = array( 'posts_per_page' => 2, 'meta_key' => 'pworks_popular_posts', 'paged' => $page_nr ); $query = new WP_Query($args); ...
0
votes
2answers
42 views

Custom query: Get all posts that are from a certain category?

This is what I have: global $wpdb, $month; $months = $wpdb->get_results( "SELECT * FROM $wpdb->posts WHERE post_type = 'post' AND post_status = 'publish' AND DATE_FORMAT( ...
0
votes
1answer
70 views

WP_Query count of different meta key values [duplicate]

I need to get count of different values of meta_key: Let's say I've got meta_key $class & there's only three different values: 1, 2 & 3. //My WP_Query $ads = new WP_Query(array( ...
0
votes
2answers
44 views

Custom post types and 'new WP_Query'

I have custom post type 'Partnerzy' already set. While adding new 'Partner', you select a category (kredyty, leasingi, etc.). And having that, I need to show them on a page, like this: I figured out ...
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
0answers
27 views

wp query custom orderby not custom field

I am working on a products archive page where I show 20 products on each page with pagination. Each product's price is calculated by a formule which gets his parameters by data saved in the database. ...
3
votes
1answer
40 views

Ignore a filter on the media library

As per my question yesterday, I need to exclude all images from most of my WordPress queries - yesterday, I thought I needed to exclude them from all queries, until I came upon the following issue. ...
3
votes
3answers
300 views

How do I exclude all images from a wp_query?

I want to query attachments and exclude all images. I can see how to include only images, using 'post_mime_type' => 'image/*', but I couldn't find any way of achieving the opposite. Is there any ...
0
votes
1answer
32 views

Compile meta values from custom loop into array and then calculate sum total

I tried explaining this yesterday but I fear I made things more complicated than they needed to be. I have a custom loop that pulls through standard Wordpress posts with various arguments. $args = ...
0
votes
1answer
15 views

WP_Query with page_ids in arguments without a result

I want to get some pages with WP_Query: $resume_args = array(); $resume_args['post_type'] = 'resume'; $resume_args['posts_per_page'] = -1; //$resume_args['page_id'] = array(9046, 9346); //No ...
0
votes
1answer
58 views

Problems with WP_Query, Loop, a condition and Posts per Page

I am creating a website and I have Custom Types (Plugin: Types). These Custom Types are called 'Veranstaltungen' --> they are Events. All of these Events have a starting date ( start-datum ) and an ...
0
votes
0answers
22 views

WP_Query: Meta_Query with serialized value (or a workaround)

I have a post type Issue, that has meta values in form of associative arrays (that are saved as serialized strings to database). They look somewhat similar to this: [article_reviews] => Array ...
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' ...
1
vote
1answer
58 views

Rewrite rule to prettify two $_GET variables while in a new endpoint from a page

I'm trying to create a permalink rule which is a few levels deep. I have a basic page /page-slug/ - I'm appending to it a new endpoint: /page-slug/my-endpoint/ - from here I need to nest one id and ...
0
votes
0answers
20 views

How to remove the most recent post from $the_query

Apologies for a very basic question: I've been searching for hours and can't find a solution. I have a Wordpress page that displays all posts of a particular custom type by using WP_Query to return ...
1
vote
1answer
63 views

Front End Sorting Questions

Please bare with me as I am self taught and trying to learn as much as possible. I am going to try and provide as much information as possible that I have learned from researching this problem. My ...
0
votes
1answer
53 views

Show one post per author and limit query to 8 posts

I want to show 8 recent products from multiple authors on the frontpage. Need to show 1 recent product per author. Currently i'm using basic wp query to show recent 8 products. $args = array ( ...
0
votes
1answer
96 views

Genesis filterable portfolio isotope [closed]

I've this working genesis filterable portfolio and I want to share with You. I was inspired by It works at any level of tax you are and show only the immediate child-terms to filter (like you can ...
0
votes
1answer
16 views

How can I use WP_Query argument 'Like %..%'?

I didn't find a good headline but this is my problem: I have this code (works fine!): $resume_args = array(); $resume_args['post_type'] = 'resume'; $resume_args['posts_per_page'] = 7; ...
0
votes
1answer
22 views

CPT Efficient way to display posts from different categories with custom query

I have created a custom post type named "my-products" and registered custom taxonomy "my-products-categories" Then I created some Categories like "Webdesign", "Print", "Logo" I need to display all ...
0
votes
1answer
41 views

Add URL Rewrite Rule To Wordpress

my link http://localhost/abm/?ct_city=la-jolla&search-listings=true i want to this http://localhost/abm/USA/la-jolla Could you help please.. htpaccss file # BEGIN WordPress <IfModule ...
0
votes
1answer
23 views

Find by post_meta, then sort by post_meta, then sort by date (wp_posts)

I have a custom meta field that I find a list of posts from. This custom meta is a numerical attribute (1-10) and I need to sort by 1-10, but I also need to sort by post date. So if two items are ...
-1
votes
1answer
25 views

No exposure on search engines

I have a blog but it doesn't show on any search engine. Why can't my wordpress blog be seen but I am always publishing.
0
votes
0answers
17 views

Displaying Taxonomy titles with their post

Suppose i have a taxonomy note_navigation like this Class 11 --Science --> THis is children of Class 11 ----Physics --> Children of Science and grandchildren of Class 11 ------ QUantum Physics ...
0
votes
1answer
21 views

Query All Attachments and Order by Parent Publish Date

I'm working on a project where I need to query all of the image attachments and then organize them based on the date the post they were attached to was published. The query below worked well, except ...
0
votes
1answer
47 views

Include tags in WP_Query

I found several posts about it. Others said that you cannot do it without a plugin and others that it is possible. However, I am not sure what is true :P This is my query and unfortunately, I cannot ...
0
votes
1answer
43 views

WooCommerce - Print Processing orders [closed]

On our WooCommerce webshop we have an PHP page that generates the processing orders. Now I need to show the SKU in the table, but I don't know how to do that :) Below is an example of the page as it ...
1
vote
2answers
66 views

Get only modified posts

I'm using this code for generating a Feed from lasted modified post mysqli_query( $conn, "SELECT * FROM wp_posts WHERE post_status = 'publish' AND post_type = 'post' ...
0
votes
1answer
32 views

Rewrite gets completely ignored

I have created a small function to rewrite a get variable. First, I created the page 'download', and I want a get variable to be used for the file attribute. This is an working URL: ...
0
votes
1answer
36 views

How To Query All Attachment Images Found In Post Galleries

I'm trying to create an image gallery which is comprised of all of the images attached to posts. The query below works well, but it ends up with all attached images rather than just the images ...
0
votes
0answers
20 views

Custom Post Type Column Filter Not Populating HTML Select After Filtering

I am trying to setup a custom post type column filter. When the custom post type management page displays the filter is populated with all of the course custom post types. I then select an option and ...
0
votes
0answers
21 views

Displaying no post message in rather complex query that shows only future events

I'm trying to do something rather simple, which is display a message if there are currently no posts available. However, the environment I want to do it in is rather complex, as I'm using the Types ...
0
votes
1answer
21 views

Creating a custom search for a specific post type

Ok, so we know Wordpress comes with a built in search form. However, I've created a custom archive page that lists posts from a specific post type. I would like to integrate a search box that only ...
0
votes
1answer
17 views

Custom pagination (Title, date and teaser)

I'm working on implementing a custom pagination for a website. Unlike default Wordpress pagination with "Older" and "Newer" links, this one requires to show the title, the date and the teaser of the ...
0
votes
1answer
58 views

Search for multiple tags?

So I have a page template that is setup as follows (using Kleo theme): Search template get_header(); ?> <?php //create right sidebar template kleo_switch_layout('right'); ?> <?php ...