How is ‘products_article_list’ meta returned from in $article_list
?
<?php $article_list = get_post_meta( get_the_ID(), products_article_list', true);?>
Is it a list of ids eg. ‘0601,0603’ or is it an array?
tax_query
terms argument requires an array. See https://developer.wordpress.org/reference/classes/wp_query/#taxonomy-parameters
So if it’s stored as a list of ids all you need to do is explode the list and it should work.
...
'tax_query' => array(
array(
'taxonomy' => 'inputs',
'field' => 'slug',
'terms' => explode(',', $article_list),
),
),
...
Related Posts:
- Using ‘strtotime’ function to convert a custom-meta-box to a date-stamp
- How to save the checked boxes?
- How to get only one category of custom post type?
- Using WPAlchemy metabox values in another metabox
- A good strategy to print custom posts (offer) that are checked inside the metabox of a post?
- What’s the difference between same wp functions get_posts(); functions in different form?
- Push metadata in array
- Troubles with saving metabox
- Why are taxonomy terms not saving when using custom meta boxes with radio button taxonomy selectors?
- How to Upload CSV Data into Custom Post Type Data with Metabox programmatically
- Display latest x posts from all categories in Custom Post Type/Taxonomy
- How can I move (or create another) publish button?
- Add additional field to custom post_type
- Meta-Boxes for CustomPostType cause PHP Errors and Notices in “Add New” view
- populate array with posts
- Is it possible to use array_walk() to append terms to an array of posts?
- meta query not retrieving posts
- Get meta values from parent post and save in child post
- Custom search for a custom post type in WordPress
- tax_query not working?
- Error get_posts with Custom Taxonomy and OR relation
- Meta box not saving
- Meta Box not being added in plugin
- Meta-Box to add multiple items one at a time and on publish save all
- Add Category names to post lists of custom post type
- How to I add count of custom posts listed in a post as a prefix to its title
- Just the First Metabox what saves the data!
- tax_query returning all posts instead of selective posts in WP_Query
- WP_Query is printing out only one post when posts_per_page is set to multiple
- WP Query to displaying date and posts for that date?
- GravityForm: Populate Dropdown with custom post type [closed]
- Return array of categories to php function for current post
- Link users to a custom post type
- Filter the content from a post globally immediately after is fetched from the database
- Create a random unique 6 digit number as custom field for custom post type
- How to output wordpress custom tags separated by comma?
- Loading all files within a directory
- Custom Post Type with metaboxes (no content) only?
- Blog page showing same content as homepage
- Custom Post Type Taxonomies -Posts not showing in Category or Tag pages
- Combine query_posts() and get_posts() into single query
- Why do I lose the content of meta boxes when I leave the page?
- Dynamically add / duplicate custom meta in custom post types
- Add TinyMCE to CPT metaboxes in 3.1?
- Custom Post Type Metabox – Not Saving
- How can I show/add/save custom metaboxes as an Array of values?
- Using several custom fields as custom post title
- Custom Post Type without an archive page
- Get rewrite slug of custom post type in template
- Show Different Header on a Specific Post ID
- WordPress nl2br is not converting newline to html line break when saving metabox value
- Unable to show meta box data in frontend
- Get Post Primary Category
- Are there sub-systems in WordPress that would employ data structures beyond CPT that a `get_posts` won’t be able to catch?
- Weird problem happening with custom taxonmy when creating/updating posts
- WordPress custom meta field for custom post not storing data
- Shortcode for display posts on home page show only one post
- Admin notice not displaying
- How can I create a custom meta box to add an mp4 video to a page?
- Can’t get order_by meta_value_num to work properly
- How to Duplicate (multiple meta box)?
- Create custom post type on successful woocommerce order [closed]
- window.send_to_editor and jQuery .attr() conflicts with multiple custom upload image meta boxes
- advanced search forms with 3 input text and that the main problem 3 input text
- List custom post types in metabox
- Adding custom tables to WordPress
- WordPress count child posts of each parent custom post type and use in json array for google maps jquery plugin
- Taxonomy Archive: Display only one post per term from separate custom taxonomy
- Create custom PAGE with register_post_type
- List of Posts in a Custom Field
- Save an array from drop-down in custom meta box
- $wpdb: Counting posts corresponding to 3 terms in 3 different taxonomies
- Query Multiple Taxominies Across Multiple Post type’s
- Using My-Meta-Box-Class plugin, how is ‘Date’ value stored?
- Very Slow Page – How to Optimize # of Queries?
- Pull a post based on a meta value in a custom post type
- Dynamic page outside WordPress
- Populate Custom Fields in a Custom Post Type?
- Change meta box when the page’s template is changed
- Duplicate Custom Header Functionality into the post edit screen
- Using wordpress template tags within an array
- Send email button in custom post type backend
- How to display Custom Post Type Post based on Tag with Shortcode Parameter?
- Getting the URL of the parent page
- Query custom post type by category slug
- Custom query to filter posts that have current post as a taxonomy [closed]
- Custom post type permalink returns bad url
- Return the thumbnail meta data for getter and setter
- Cannot save Checkbox meta box value from a Custom Post Type
- Adding dropdown select meta box to custom post type – seems restAPI is interfering
- Custom meta box not saving
- How to display selected taxonomies by their parent
- Custom Field Order by Last Name and First Name
- Custom meta box data array: foreach not working correctly?
- Undefined Variable – Custom Post Type Meta
- Pagination for custom php code
- get_posts of Custom Post Type AND Custom Taxonomy
- Changing number of posts per page on CPT-archive.php, have tried 20-30 code chunks so far
- Custom Post Type Loop throws 500 error when used in widget
- how to check if custom post type column already exists?