Browsing Category

Wordpress wp-query

Get all post meta for post where on meta key is a certain value

I have a meta key which I would like to use to get all post meta data for a post where that one meta key

Query posts only without featured image

want to query 100 posts, but only those which do not have a featured image attached. I am using meta_key method for this with WP_Query

WP Query - filtering terms with regex

is there a possibility of filtering posts by terms using regexp? My code doesn’t quite seem to work. $tax[] = [ 'taxonomy' => 'tax_name', 'field'

WP Query - filtering taxonomies with regex

is there a possibility of filtering posts by taxonomies using regexp? My code doesn’t quite seem to work. $tax[] = [ 'taxonomy' => 'tax_name', 'field'

WP_Query Breaking Page

<?php $args = array( 'posts_per_page' => 1, 'category_name' => 'news', ); $news_query = new WP_Query( $args ); if ( $news_query->have_posts() ) : $html_out = '<article

Post Thumbnail URL isn’t pulling into the background of div

I updated my code. I swapped returns with echoes. The only issue is that the post_thumbnail_url isn’t pulling into the background of div. <?php $args

Get all post order by meta_key above 0 value

I’d order post by meta_key but i’ve a problem with meta_value because is some post have (0) value, So my query get only all post

Complex date range with WP_Query and BETWEEN

Backstory We have a bunch of events inside an events custom post type. They each have the following custom fields associated to them: start_date end_date

How to Change the Custom Media Upload view to Default View

My client has a custom theme which’s has a custom option for selecting the featured image for any post. The current default view for selecting

Condensing Query with Append

I have a form that has 3 fields: Genre, Label, Era. Depending on if the field is left blank or not, I need to do

post__in not working with an associative array

I’m trying to show some posts sorted by some custom criteria using the following code: $myargs = array( 'post_type' => 'projects', 'post__in' => array(10188,10033,9239,9145,6075,5103,4963,5057,6767,5097,4725), 'posts_per_page'=>

Orderign WP_Query results by 2 variables

Reposting since I think I messed up the original post and it got rejected… I am trying to figure out the args for a WP_Query

WP_Query results ordered by 2 variables

I am trying to figure out the args for a WP_Query that will return products that are ordered by first one custom variable and then

Is overwriting the main query a bad idea?

I am in the process of rewriting a lot of my code and restructuring a lot of my theme files to use template parts (i.e.

WP_Query with rewind_posts creates duplicate titles

I have a WP_Query with rewind_posts that I use to filter posts if they belong to a particular category. Basically, if any post belongs in

Bring a post to the top of the query if it’s in a certain category?

I’m looking for a way to bring a post if it’s in a certain category to the front (or top) of the list. The category

Back to Top 107051 wordpress questions, 32 Wordpress answers.
Wordpress related, All rights reserved
Powered by Creative Advertising