Skip to content

Magenaut

  • Home
  • Topics
    • Notes
    • Tutorial
    • Bug fixing
    • Extension
    • Server
  • Q&A
  • Privacy Policy
  • About

wp-query

Using ACF values in nested WP queries for CPT with date values in the past

August 6, 2022 by Magenaut

I’m using a pair of ACF date fields to create a query on a custom post type (event). I have a “Past Events” feed which is ignoring my usual technique for creating the following behaviour:

Categories Q&A, Wordpress Tags advanced-custom-fields, custom-post-types, wp-query Leave a comment

Use more than one query, but prevent duplicates – at scale!

August 6, 2022 by Magenaut

Setup

Categories Q&A, Wordpress Tags duplicates, performance, wp-query Leave a comment

Shortcode with ‘year’ parameter

August 6, 2022 by Magenaut

I would like to display posts with a ‘year’ parameter. For example: to display posts from 2020, the shortcode should look like [archived-posts year=”2020″]. I have tried my code below but it’s not working. Maybe the ‘meta_value’ is not correct? Any help would be appreciate it.

Categories Q&A, Wordpress Tags posts, query-posts, shortcode, wp-query Leave a comment

Get user posts with custom WP_Query on author.php

August 6, 2022 by Magenaut

I try to show custom post list with WP_Query on author.php like this:

Categories Q&A, Wordpress Tags author-template, wp-query Leave a comment

search blog posts by author first name and or last name

August 6, 2022 by Magenaut

I am trying to create and endpoint where blog posts can be searched by author first name and/or last name. I was trying to do this with WP_Query but it uses the user nice name for the search which is not working. Is there a way to do this using a built in query or do I need to do a custom SQL query?

Categories Q&A, Wordpress Tags posts, rest-api, wp-query Leave a comment

How to use WP_Query without breaking the main Query

August 6, 2022 by Magenaut

The WP Query class can be used to make almost any imaginable query to the WP database. It’s amazing.

Categories Q&A, Wordpress Tags wp-query Leave a comment

date_query in pre_get_posts out of memory

August 6, 2022 by Magenaut

I’m trying to apply a Datefilter for specific categories.

Categories Q&A, Wordpress Tags date-query, fatal-error, pre-get-posts, wp-query Leave a comment

Get list of terms that have posts in another term

August 6, 2022 by Magenaut

I have a product attribute called “color” and when I am on the archive page (e.g. color=blue) I want to display a list of all the parent product categories that contain products with that attribute, color=blue.

Categories Q&A, Wordpress Tags tax-query, terms, wp-query Leave a comment

Pagination not working on custom query on a page

August 6, 2022 by Magenaut

I have a custom query on a page (it is not an archive page), it works just fine, but I want pagination and it is not working at all…

Categories Q&A, Wordpress Tags custom-post-types, loop, query-posts, wp-query Leave a comment

How to find exact match for search term in WP_Query? What is the additional string added in LIKE query in WP_Query?

August 6, 2022 by Magenaut

While searching with the argument s it adds additional value before and after each Like query

Categories Q&A, Wordpress Tags mysql, query, search, wp-query Leave a comment
Older posts
Newer posts
← Previous Page1 Page2 Page3 … Page25 Next →
  1. michealSmith07 on Is there a way to dynamically refresh the less command?August 21, 2022

    That is a very nice post. I like this post.

  2. anonymous on Fix libwacom9 dependency issue when upgrade DebianJune 27, 2022

    saved my day!! Thanks for the help…

  3. sreedhar on Fix libwacom9 dependency issue when upgrade DebianMay 10, 2022

    Thanks its working

  4. saintnick on Fix libwacom9 dependency issue when upgrade DebianMay 10, 2022

    remove libwacom2 worked for me as well

  5. ranafoul on Fix libwacom9 dependency issue when upgrade DebianApril 22, 2022

    apt remove libwacom2 helped on kali 2022.01. gr8

.net ajax asp.net asp.net-core asp.net-mvc asp.net-mvc-3 asp.net-mvc-4 asp.net-web-api bash c# command-line css custom-post-types custom-taxonomy dataframe dictionary django entity-framework functions gridview html iis javascript jquery json linux list matplotlib numpy pandas php plugin-development plugins posts python python-2.7 python-3.x security shell shell-script sql string vb.net webforms wp-query

© 2026 Magenaut • Built with GeneratePress