Skip to content

Magenaut

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

wp-query

Should we trust the post globals?

August 5, 2022August 4, 2022 by Magenaut

@toscho left a comment to this answer which had me thinking again. How much trust should we have in the global scope, specially regarding the post globals like $post?

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

Using wp_query is it possible to orderby taxonomy?

August 5, 2022August 4, 2022 by Magenaut

My question is simple, I’m using WP_Query to retrieve some custom type posts filtering by a taxonomy using tax_query.

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

Custom Taxonomy WP_Query for All Terms in a Taxonomy?

August 5, 2022August 4, 2022 by Magenaut

Is there an easy way to query for any posts that is tagged with any term from a particular taxonomy?

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

Loop within a loop?

August 5, 2022August 4, 2022 by Magenaut

I’m using a couple of custom wp_query loops on my page, the first one retrieves news from a certain category then displays a small excerpt from it with the permalink.

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

WP Query Args – Title or Meta Value

August 5, 2022August 4, 2022 by Magenaut

How do I query by meta_value or title?

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

Pagination returns 404 after page 20

August 5, 2022August 4, 2022 by Magenaut

I got a paged loop that pulls in 4 posts per page from custom post type. It works great, with the only downside that the pagination wont go over the page/20 everything after that is 404, and the posts_nav_link won’t show the next arrow at all. Like the pages just aren’t there.

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

Using pre_get_posts with WP_Query

August 5, 2022August 4, 2022 by Magenaut

I was reading Stephen Harris‘s excellent answer to this question regarding the use of WP_query(), query_posts() and pre_get_posts.

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

WP_QUERY Get posts by category and similar name (Like)

August 5, 2022August 4, 2022 by Magenaut

I have a small problem with WP_Query. I want to get the posts filtered by category and with similar project name (like query), so I’m trying this code:

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

Meta_query compare operator explanation

August 4, 2022August 3, 2022 by Magenaut

I noticed that there are bunch of operator can be use for compare in meta_query.
However, I am not quite sure what operator I should use, it is somehow confusing like = and LIKE operator.

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

How to use a custom post type archive as front page?

August 4, 2022August 3, 2022 by Magenaut

I’d like to use a custom post type archive as a site’s front page, so that

Categories Q&A, Wordpress Tags custom-post-type-archives, custom-post-types, functions, wp-query Leave a comment
Older posts
Newer posts
← Previous Page1 … Page9 Page10 Page11 … 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