OK, I have no idea how and why your code should work… It has nothing in common with correct PHP syntax… But it’s pretty good pseudo-code, so I think I can guess, what you wanted to achieve…
$tax_query = array();
if ( have_rows('category_taxonomies') ) {
while ( have_rows('category_taxonomies') ) {
the_row();
$tax_query[] = array(
'taxonomy' => 'taxonomy', // <- you should put real taxonomy name in here
'field' => 'slug',
'terms' => get_sub_field('category_taxonomy')
);
}
}
$posts = get_posts( array(
'posts_per_page' => 10,
'post_type' => 'company_product',
'tax_query' => $tax_query
));
Related Posts:
- ACF – Get ID of relationship field in flexible content
- Looping through WP_Post Object
- Can an array be used as a meta_query value?
- Must Use Plugin Causing Query Error
- Advanced Custom Fields: Post Object – Not returning data [closed]
- ACF page while loop breaks footer while loop
- Using Advanced Custom Fields to create a per page slider
- Checking array against author id in loop
- Advanced Custom Fields – display label and value only if value entered
- How to get the last category name of a child category?
- Show ACF field with link to ultimate member profile/WordPress user profile below the post (single post layout)
- WordPress loop by meta key that is an array? and how loop multiple arrays
- Only show first image in foreach loop
- Conditional multidimensional arrays and array_map
- Get all posts as an array ID => Name
- in_array not working on dev server but works on localhost
- Show the subcategory name based on current product
- How to output values from a loop into a javascript array
- ACF background-color per post in a WordPress loop
- Make sticky post with FacetWP
- PHP for loop not working as intended
- Display a single row from nested array of custom field data
- Page returning ID from array, how to return the correct values for post in acf wordpress
- WP_Post is not from correct array
- Create Customization Controls from Array
- ACF loop and php formatting
- the_post_thumbnail unless video id is added
- Custom WordPress Function – Adding items from Foreach Loop into an array and Updating Field based on array of IDs (ACF + WooCommerce)
- How to get URL of current page displayed?
- What is This esc_html_e() i wordpress php?
- How to store the_title() into a variable to reutrn the value, not just echo it
- How to update single value in multi dimensional Post Meta?
- List events by month
- The values of custom fields are not available functions.php
- How to change post count in wordpress loop?
- How can I loop into two different DIVS without repeating the DIVs
- Display related products with custom output
- How do I dynamically generate args for wp_query?
- How can i display post loop in table format?
- How to select WooCommerce products by post_meta and order them
- Working with query_posts ( arrays and query strings)
- Storing Array from returned database query and using the array in a new query
- Changing layout with wp_customise
- Why my filterable portfolio page work not perfectly between slug button and slug output WORDRPESS?
- get author_name from queried post
- Exclude posts based on meta value
- How Can I use WP_Query to Only Display 1 Post from Custom Post Type if Query Returns Posts with Matching ID in Custom Field
- post thumbnail, conditions, else wont work
- wp_force_remove_style’ not found
- How can I access string value in an array?
- I’m trying to create an array with a foreach loop, but the array only stores the last item [closed]
- Filtering a function’ output for a new continued function
- Why in my theme I can’t see all the statics content under the posts?
- How to unlink all posts from tracking same amount of views
- If Array Values Match Another Array’s Values, Then
- I’m unable to call img path using single quotes in an array?
- Problem with custom loop and wp_list_pluck [closed]
- Refactoring long if/else php chains
- Get the id of all images in a post
- Output category list inside array
- Update post meta – Custom field does not match meta-key
- First post article different on Archives template
- How to add title attribute to archive items
- How To Pass Array To get_the_category_by_ID() and Get An Array Back?
- Strip from or something better?
- Add custom fields from different posts
- Display acf taxonomy attachment
- Nested Queries of decreasing specificity
- ACF: Display Google Map in frontend issues
- How to Create Carousel Indicators in PHP Loop using wp_get_attachment_url function?
- Get title of page containing post grid within the posts
- Is there anyway I can call the year once?
- How to display MySQL table data which is stored as an array?
- Foreach Loop Of Post Types With Nested If Else If Not Completing Process
- cURL needing to loop through all “next_page”
- Display page content in different sections – based on page break block?
- Filtering custom posts by using checkboxes for taxonomy in an ajax loop always gives server 500 error
- Javascript Tab Gallery with Advanced Custom Fields
- How can I get my pagination loop to display the correct number of total pages?
- Notice : Array to string conversion on array_intersect user meta
- Generate a radius search of custom post type locations
- Get current_post in reverse order with pagination
- Is there a reason why my wordpress PHP page isn’t loading into my PHP template
- Display posts using post ID’s in an array
- Div Missing In Custom Loop Query
- Using page template to fetch posts in page
- Reformat data within a nested array
- !in_array doesnt recognize category
- Custom field within shortcode
- Custom Meta Box If Else Statement
- How to set if meta_value is lower < than other meta_value in a get_posts array?
- ACF allow zero as a value
- Alternative loop syntax error [closed]
- Populate checkboxes from array
- ACF loops false value with repeater and checkbox
- Woocommerce linking variations
- Why is my array_diff usage breaking things?
- Creating posts with php-script + csv
- PHP – Converting elements to actual values
- How do I display WooCommerce products in my query to rows of 3?