If you have your data in separate table adding support for it in query is somewhat messy. Basically you will need to filter posts_where
and posts_join
to modify raw SQL query so that your custom table is joined and checked against your custom values.
As per [faster :)] anu’s suggestion it would make sense to store values in Custom Fields and use Custom Field Parameters (related to Orderby, but not same thing) in query.
Related Posts:
- if statement on database query
- Create WP_Query to search for posts by their categories or their parent/child categories
- WP_Query adds “(wp_posts.ID = ‘0’)” so no results are returned
- inserting a post from an extern php file but post content doesn’t show on wp site
- Execute multiple PHP Snippets causes error?
- How to return number of found rows from SELECT query
- Check if post of title already exists
- $wpdb->delete column values IN ARRAY()?
- Get posts by menu ID
- Build a content and excerpt grid loop with paging and options for # of posts
- How To Make Connection To WordPress Data Base In A Plugin?
- Changing user_nicename
- Does WordPress cache get_user_meta() results?
- WordPress will not operate correctly
- How to Join two tables from separate databases within WordPress
- Show only one post for each author ( Page loads too slow )
- error importing localhost export file to server
- Would manually deleting the dumping data fix a “#1062 – Duplicate entry ‘1’ for key ‘PRIMARY'” phpMyAdmin error?
- How to sort results from a custom database table
- How can I call a row of user specific data from a custom table added to the WP Database
- how to display active, upcoming and past event with featured listing with pagination
- How to track a users progress through pages by inserting data into WordPress Database?
- Import 10,000 Users into WordPress WITH a specific ID for each user
- Modern Tribe Calendar wp-query with meta query not working at all
- WP database error for comments_popup_link()
- Unusable menus and “Illegal widget setting ID: nav_menu_item[]” error
- No wp-config.php file on local install of wordpress – site still displays
- How to migrate the posts from an old custom legacy blog to a new WordPress website?
- Insert all post IDs in new database table
- Different database query in function.php using mysqli
- How to create and work with custom data / tables (i.e., for arbitrary data)?
- Looking for most performant way to execute several similar WP queries within shortcodes
- Why is variable not working on custom sql query using wpdb?
- Can’t search posts using WP_QUERY inside AJAX Function
- How to securely provide a $_POST var in WP_Query with PHP 7?
- WordPress not reflecting changed of the database
- How can I save unique user data on my site? [closed]
- Update results, Before deleting the related category [closed]
- get_posts() and WP_query limits ‘AND’ conditions to a maximum of 6 for meta value queries in WordPress
- database sent to a JSON file
- Using custom tables for old posts
- Not connecting to database in file with multiple MySQL connections
- How to get post ID in a Page?
- WordPress Block developer from exporting Database via PHP
- How to retrieve the data from the sever and displaying it in a page?
- wpdb prepare insert table doesn’t work
- Should I use WordPress to skin a database website?
- How do I display offsite database info on my wordpress site?
- Creating Database Table vs. Adding MetaData to Post & User
- WordPress and MySQL: trying to print data using PHP from user_meta custom field data
- Most commented posts by time period (last 12h, last 24h and etc)
- I can’t update my data through $wpdb
- Custom route and query
- change the default order of posts only for specific categories
- WordPress WP_Query without query GET parameters
- Why when I create a new post I found 2 record related to this post into the posts database table?
- Adding data to custom wordpress database table
- posts_nav_link pulling in multiple post types
- phpMyAdmin error #1062 – Duplicate entry ‘1’ for key ‘PRIMARY’
- Remove Post if Advanced Custom Field is checked to fix paging
- Add row to custom database Table and delete all rows older than 1 day
- select a single val though a table in wordpress
- SQL error with custom query
- How to WP_Query posts order by parent title?
- search.php to search only the post title
- What’s wrong in my PHP code? I’m using WordPress Astra Theme and I can’t insert data into my SQL
- Passing in MySQL prepare statement parameter separately throwing error
- Please help! I have a problem with getting wordpress databas
- Error establishing a database connection (Set-up locally)
- WordPress sorting posts by date and title using a dropdown
- PHP Warning: mysqli_query(): after updating my websites php from 5.6 to 7.2
- Usermeta data unserialize, extract and display in table in WordPress
- how to get data from two different table from wordpress database
- Using wpdb to connect to a different database is not working
- Insert data from form to database
- Query doesn’t display text data with apostrophes
- SQL Query Search page
- How can I display a query in a page?
- direct query to post_meta table
- can’t delete a row from post_meta table
- Create a hierarchical loop at predefined markup requirements
- How to set max users to 17.000
- Weird Behaviour: Not all WordPress Posts appearing
- two wordpress sites, two themes, one database, same content
- Insert double entry in DB
- How to connect database table to each registered wordpress user.
- Let users register weight each day and save it in DB
- MySQL database migration to WordPress
- Query specific posts per user selections from dropdown menus
- Does wp_query and query_posts affect website performance? [duplicate]
- How to pass username into form that sends data to database
- How to edit the default database of WordPress [closed]
- Pagination in category.php not functioning
- How to modify this function to exclude also the post belonging to a specific category?
- Display total count of products in orders of a specific order status
- Custom form that stores data in mysql database
- /page/2/ redirect to 404
- How do I exclude the current post from the upcoming post query
- Putting form result in my database
- Can’t insert into a database wordpress