Skip to content

Magenaut

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

query-posts

Some doubts about how the main query and the custom query works in this custom theme?

August 5, 2022August 4, 2022 by Magenaut

I am pretty new in WordPress theme development and I’m not so into PHP (I came from Java and C#) and have the following situation in this custom theme

Categories Q&A, Wordpress Tags loop, query-posts, wp-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

Using WP_Query to Query Multiple Categories with Limited Posts Per Category?

August 4, 2022August 3, 2022 by Magenaut

I have 3 categories with each 15 posts, I want to do ONE query to the db bringing only 5 first posts for each category, how can I do it?

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

When to use WP_query(), query_posts() and pre_get_posts

August 4, 2022August 3, 2022 by Magenaut

I read @nacin’s You don’t know Query yesterday and was sent down a bit of a querying rabbit hole. Before yesterday, I was (wrongly) using query_posts() for all my querying needs. Now I’m a little bit wiser about using WP_Query(), but still have some gray areas.

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

Custom query with orderby meta_value of custom field

August 4, 2022August 3, 2022 by Magenaut

Aa you know, as of WP3.0 there are options for custom advanced queries, which is great.
As of this, some query parameters of custom fields like meta_key, meta_value were deprecated for the new meta_query parameter (see here)

Categories Q&A, Wordpress Tags custom-field, query-posts Leave a comment

How to get posts published between a date and today?

August 4, 2022August 3, 2022 by Magenaut

Is it a way to get posts published between a date and today with query_posts() ?

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

How do I query a custom post type with a custom taxonomy?

August 4, 2022August 3, 2022 by Magenaut

For some reason I’m finding it a struggle to grab any posts using a custom taxonomy… can anyone unravel my stupidity?

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

Alternative to query_posts for main loop?

August 4, 2022August 3, 2022 by Magenaut

Possible Duplicate:
When to use WP_query(), query_posts() and pre_get_posts

Categories Q&A, Wordpress Tags codex, documentation, query-posts Leave a comment

Get posts from sites in Multisite?

August 4, 2022August 3, 2022 by Magenaut

I’m trying to pull multiple sites posts. For example, I can pull out a single site
posts by a category and total posts 10.

Categories Q&A, Wordpress Tags categories, multisite, query-posts Leave a comment

Help to condense/optimize some working code

August 4, 2022August 3, 2022 by Magenaut

WordPress by default shows ALL posts to users who are Authors. I wanted Authors to only be able to see their own posts so I came up with the following code which works well.

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