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

wp-query

pull data from wordpress database

The following should do the trick: global $wpdb ; // get the post_ids from the custom table $sql = “SELECT listing_id FROM {$wpdb->prefix}wpdbdp_listing_fees WHERE fee_id = %d” ; $sql = $wpdb->prepare ($sql, 4) ; $post_ids = $wpdb->get_col ($sql) ; // get the custom posts from the posts table $args = array ( ‘post__in’ => $post_ids, … Read more

Categories plugin-development Tags conditional-content, database, mysql, plugin-development, wp-query

Wp_query loop is not working as it should

Wp_query loop is not working as it should

Categories posts Tags loop, posts, slideshow, wp-query

Saving custom fields for WP_Query to retrieve

For future reference on this question. I solved my problem by updating my save routine to save each field to its own key. This does work much better since each fields is saved to its own corresponding key it makes retrieval from WP_Query much better /* check if this is an autosave and if YES … Read more

Categories wp-query Tags meta-query, metabox, post-meta, wp-query

Issue generating custom filter for cpt admin columns

You’ve probably hooked into one of the WP_Query-related actions/filters (e.g., pre_get_posts) and altering the query when isset( $_GET[ ‘partner’ ] ) == true. Find a way to conditionally avoid that modification (e.g., checking if $query->is_main_query()).

Categories wp-query Tags admin, filters, wp-query

Woocommerce WP_Query post__not_in problem

If you have both post__in and post__not_in as input arguments for WP_Query, then only post__in is activated. See the source here. If you need to exclude IDs from the post__in, you should do it before passing on the array.

Categories wp-query Tags woocommerce-offtopic, wp-query

How to use costum database table for custom post type

How to use costum database table for custom post type

Categories custom-post-types Tags custom-post-types, wp-query, wpdb

WP Query Relations / Compare

You don’t provide the context of where the code in your question is being used. Is it something like the following: $args = array ( ‘s’ => ‘201701057’, ‘meta_query’ => array ( ‘relation’ => ‘OR’, array ( ‘key’ => ‘property_address’, … ), array ( ‘key’ => ‘property_city’, … ), … ), ) ; $query = … Read more

Categories plugin-development Tags plugin-development, query, query-posts, search, wp-query

Post Pagination does not working on WP-Query

Post Pagination does not working on WP-Query

Categories plugin-development Tags plugin-development, theme-customizer, theme-development, themes, wp-query

Exclude all tagged posts from WP_Query loop

Use the tax_query parameter with the taxonomy set as post_tag. See the following previous answer: Get all posts without tags

Categories wp-query Tags tags, wp-query

why default wordpress loop not working outside index.php

why default wordpress loop not working outside index.php

Categories wp-query Tags loop, wp-query
Older posts
Newer posts
← Previous Page1 … Page130 Page131 Page132 … Page594 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