meta_query for a string inside a meta field containing a comma-separated list
In my project the WP users have a custom meta field “usergroup” containing a comma separated list of values. The meta field can contain values like this:
In my project the WP users have a custom meta field “usergroup” containing a comma separated list of values. The meta field can contain values like this:
I’ve got lots of posts with promotional prices and the rest have an exact price. I just wanted to make sure that if promotional price exists, use the promotional price as the target data when I try to submit a value from the input range else use the real price.
On my Club Profile pages, I’m displaying a list of posts (Player Profiles) where the title of the specific Club Profile page is also a meta value contained in those Player Profiles against one or two keys: Previous or Later.
function slb_subscriber_column_data( $column, $post_id ) { // setup our return text $output = ''; switch( $column ) { case 'title': // get the custom name data $fname = get_field('slb_first_name', $post_id ); $lname = get_field('slb_last_name', $post_id ); $output .= $fname .' '. $lname; break; case 'email': // get the custom email data $email = get_field('slb_email', $post_id … Read more
I want to know if for a given post ID $post_id, there is a metadata key and value pair stored that matches a given key $meta_key and value $meta_value pair.
My products have no in-stock status, just a quantity in stock. Is there any way to make meta query to treat its value as 0 or 1? Like, first the values that are not 0, then that are 0.
I want to display a Custom post Type “Companies” filtered by zipcode.
I’m working on a plugin for WooCommerce which uses a cpt called Restock. In a Restock post you can enter products ( id ) plus restock. The user can add as many product restock pairs as they want per post.
I used this solution to count number of posts for each category (list).
The counting is based on date post event (only from today’s date).
I’m trying to run a query that returns all the posts with a given value for a specific meta key. I know for a fact that this is none of the posts on my test server but it reports finding all the posts with a post count of 7 (there are 21 posts).