Skip to content
Read For Learn
Read For Learn
  • Database
    • Oracle
    • SQL
  • C
  • C++
  • Java
  • Java Script
  • jQuery
  • PHP
Read For Learn
  • Database
    • Oracle
    • SQL
  • C
  • C++
  • Java
  • Java Script
  • jQuery
  • PHP

query-posts

pre_get_post alter current post id

pre_get_post alter current post id

Categories plugin-development Tags plugin-development, pre-get-posts, query-posts

Display custom tags on pages that have a specific page parent

From what I understand you have a loop that displays up to 500 pages. If the page parent = 18219 than you want to query the tags for that page. As far as I know, by default WP does not allow you to tag Pages, only Posts. But let’s pretend you have a plugin that … Read more

Categories wp-query Tags custom-taxonomy, pages, query-posts, wp-query

How to get Related Custom Posts?

How to get Related Custom Posts?

Categories customization Tags customization, post-formats, query-posts

Query posts based on the meta key values of logged-in users?

Best way i think would be to add an array of read post IDs to the user meta table and use them in the ‘post__not_in’ Parameter in the pre_get_posts hook. In my mobile right now, so i will edit this answer once i’m at work to insert a code example.

Categories custom-post-types Tags custom-post-types, query-posts, user-meta, users

Homepage’s content is dependent on the custom field values (set automatically), how do I get homepage to update without manually updating page?

Homepage’s content is dependent on the custom field values (set automatically), how do I get homepage to update without manually updating page?

Categories custom-post-types Tags custom-field, custom-post-types, functions, posts, query-posts

Random ajax load only works with posts_per_page set to -1

Random ajax load only works with posts_per_page set to -1

Categories posts Tags ajax, posts, query-posts, wp-query

How to retrieve an array of post IDs by a particular value stored in a custom meta’s array

How to retrieve an array of post IDs by a particular value stored in a custom meta’s array

Categories query-posts Tags post-meta, query-posts

How to display an other custom post type in a different custom post type’s archive?

How to display an other custom post type in a different custom post type’s archive?

Categories wp-query Tags custom-post-type-archives, custom-taxonomy, permalinks, query-posts, wp-query

Show all taxonomy’s terms’ posts having another taxonomy’s term in common

I finally got it to work properly. I am posting the solution so maybe other people need something similar can use it. It seems what I needed to do is use get_posts with the same arguments as WP_Query and check if there are posts by modifying the “if” statement already existed inside “foreach”. All code … Read more

Categories custom-taxonomy Tags custom-taxonomy, query-posts

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

Your actual question is basically when to run a custom query and when to make use of the main query. Lets break it down in three parts PART ONE When to run a custom query (This is not a definitive list) To create custom content sliders To create a featured content area in a page … Read more

Categories wp-query Tags loop, query-posts, wp-query
Older posts
Newer posts
← Previous Page1 … Page77 Page78 Page79 … Page128 Next →
+ More

Recommended Hostings

Cloudways: Realize Your Website's Potential With Flexible & Affordable Hosting. 24/7/365 Support, Managed Security, Automated Backups, and 24/7 Real-time Monitoring.

FastComet: Fast SSD Hosting, Free Migration, Hack-Free Security, 24/7 Super Fast Support, 45 Day Money Back Guarantee.

Recent Added Topics

  • Bug in translation system: load_theme_textdomain() returns true, files are available and accessible but the language defaults to english
  • Post Navigation Elementor
  • Custom Elementor controls not appearing in the widget Advanced tab using injection hooks
  • WPFacet multiple loop displaying duplicate content
  • Get the name of the template/*html file used
  • Fix: WordPress.DB.PreparedSQL.NotPrepared Plugin Check (PCP)
  • Removing unnecessary CSS and JS code from wp_head()
  • hexagonal image gallery. Am I on the right track? [closed]
  • Trying to Add Paging to Single Post Page
  • Sharing media files between live and staging servers
© 2026 Read For Learn
Next Page »
  • Database
    • Oracle
    • SQL
  • algorithm
  • asp.net
  • assembly
  • binary
  • c#
  • Git
  • hex
  • HTML
  • iOS
  • language angnostic
  • math
  • matlab
  • Tips & Trick
  • Tools
  • windows
  • C
  • C++
  • Java
  • javascript
  • Python
  • R
  • Java Script
  • jQuery
  • PHP
  • WordPress