Skip to content

Magenaut

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

query

How to create a filter and add query params to all links

August 4, 2022 by Magenaut

I have been trying for days and cannot get it to work

Categories Q&A, Wordpress Tags query Leave a comment

remove query arg from url after set query

August 4, 2022 by Magenaut

i make migration plugin from specific script to wordpress, but i have a problem on redirect old urls to new one

Categories Q&A, Wordpress Tags htaccess, query, rewrite-rules, url-rewriting, wp-query Leave a comment

INSERT ON DUPLICATE KEY UPDATE failes in postmeta table

August 5, 2022August 4, 2022 by Magenaut

INSERT ON DUPLICATE KEY UPDATE Mysql query is not working with Postmeta table. It adds new/duplicate rows to the table. I couldn’t find a way to solve this. I need to use this as part of a bulk import script.

Categories Q&A, Wordpress Tags bulk-import, import, post-meta, query Leave a comment

First x post with another template then the others

August 5, 2022August 4, 2022 by Magenaut

I want to output the 5 latest posts. But the template of the first 2 must be different than the other 3 posts. So I’ve created two queries.

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

$post->ID not working in combination with a custom query

August 5, 2022August 4, 2022 by Magenaut

What is the reason that $post->ID is not working in metabox_callback after adding a custom query. How can I avoid this? Should I use $post_id = isset( $_GET['post'] ) ? $_GET['post'] : ( isset( $_POST['post_ID'] ) ? $_POST['post_ID'] : false ); instead of $post->ID?

Categories Q&A, Wordpress Tags metabox, query Leave a comment

How to fix pagination for custom loops?

August 5, 2022August 4, 2022 by Magenaut

I have added a custom/secondary query to a template file/custom page template; how can I make WordPress use my custom query for pagination, instead of using the main query loop’s pagination?

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

When should you use WP_Query vs query_posts() vs get_posts()?

August 5, 2022August 4, 2022 by Magenaut

It seems like half the tutorials in the Codex and around the blogosphere use query_posts() and half use WP_Query.

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

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

Pagination not working with custom loop

August 4, 2022August 3, 2022 by Magenaut

I’ve got a custom loop that I’m using to display some Real Estate listings that will be available within 60 days. I’m calling it with the following function:

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

How can I create a meta_query with an array as meta_field?

August 4, 2022August 3, 2022 by Magenaut

Here are the args for my query :

Categories Q&A, Wordpress Tags meta-query, query Leave a comment
Older posts
Newer posts
← Previous Page1 Page2 Page3 Page4 … Page7 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