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)
- Blog posts repeat
- How to use thumbnail size of image if I’m only using src to get image
- Slick + PHP + ACF + JQuery slide reveal not working
- How to add condition in wordpress loop? [closed]
- Woocommerce : Can’t get product info in loop
- How to set variable, pass it to a partial file and remove it after?
- how to refresh div on template part?
- Exclude posts based on meta value
- Alert Bar section within WP loop is displaying even though there are no posts
- remove post that has no content
- Display category name only once inside loop
- Can’t find infinite loop cause
- How do I Turn This Into An if statement?
- Stuck in the query loop
- Load wordpress content in other domain
- 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
- Checkbox doesn’t stay checked, conten
- Sort by page information by Ascending Numbers
- Redirect to another page using contact form 7? [closed]
- post thumbnail, conditions, else wont work
- Widgets in the loop if active
- Alter required message using comment form api
- List posts that don’t have a specific tag?
- Changing the_posts_navigation() html output
- Can we count the WordPress Loop
- Get post id within comments loop
- Advanced Custom Fields not displaying
- meaning of (array)function()
- Syntax error when I try to insert my loop into an unordered list? [closed]
- WP_Query fails despite having 1 post
- Grouping posts by a custom meta value
- wp_force_remove_style’ not found
- Add content after the first post in WP Loop
- wp_query get the 2nd post
- Loop stopped working
- Download PDF after CF7 form submission
- How to get post ID in a Page?
- How to fix this warning:call_user_func_array() expects exactly 2 parameters, 1 given in D:\wamp\www\…….\wp-includes\class-wp-hook.php on line 286
- How can I access string value in an array?
- How to use if statement in an array? [closed]
- Custom Pagination is Broken
- Display an image if odd number of posts in grid
- How to loop through all the attached images in a post, and get their url one by one
- How to array only one key from another 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
- How to create an ACF shortcode with Repeater Field in WordPress? [duplicate]
- PHP Warning: strip_tags() expects parameter 1 to be string?
- Output meta into arrays
- Store post content in a php variable and output them using for loop
- How to add div blocks after certain set of post
- Get html data with javascript to php array and store to wordpress database
- Echo a shortcode div after every 3 posts
- How to avoid duplicates when creating recent network posts
- How to overwrite orderby with add_query_var
- What file have I to create in my custom WordPress theme to show all the post belonging to a specific category?
- How do I create a numbered list with PHP? [closed]
- Why in my theme I can’t see all the statics content under the posts?
- 2nd page displaying the exact same posts as my first page (minus the very first post)
- Why is an array created in a function hooked to customize register populated when customizer is loaded but not when the front-end is loaded?
- How to create a multidimensional array with multiple loops
- Is the 404 page automatically displayed if a loop returns nothing?
- How do I remove a category from a wordpress loop>
- How to use array in function to get only value I want
- Error while setting role
- Get categories names as an array to use it in theme settings
- variable value disappears in a second loop
- Last class on last headline?
- Show recent posts starting at a specific number archive
- Upload non-featured image to image field
- get_the_ID() in the footer returns wrong value
- How to say if meta_value is greater than 0 in an array?