ACF – How to get custom taxonomy term image field

I found a solution for this: <?php $current_term_id = get_queried_object_id(); $taxonomyName = “car-brand”; $parent_tax_ID = $current_term_id; $parent_tax = get_term($parent_tax_ID); $terms = get_terms( $taxonomyName, array( ‘parent’ => $parent_tax_ID, ‘orderby’ => ‘slug’, ‘hide_empty’ => false ) ); foreach ( $terms as $term ) { $image2 = get_field(‘am-brand-img’, $term); echo ‘ <div class=”am-ts-item”> <a href=”‘ . get_term_link( $term … Read more

Is it possible to use the_post 2 times in one loop

Yes, but not by calling the_post twice in a loop. Instead, use 2 loops and rewind_posts. The first loop displays column1 and skips even posts. Then you call rewind_posts() to go back to the beginning. The second loop displays column2 and skips odd posts. After the first loop, call rewind_posts(); and it will rewind the … Read more

Giving each loop post unique numbers so that WordPress would treat separately

Change your <video> id to be a class, so that there can be multiple of them on a page. Use .querySelectorAll(‘video.local-video’) to get all video elements with the class name of .local-video. Loop through all of those elements, and play them accordingly. Code: <!– Autoplay, on view video START–> <script> const localVideos = document.querySelectorAll(‘video.local-video’); // … Read more

Loop through categores and posts of a custom post type in WordPress?

You can try this code logic and see if it works. // Get all categories $category_args = array( ‘orderby’ => ‘name’, ‘order’ => “ASC”, ); $categories = get_categories( $category_args ); // Get all Categories // Loop through each category foreach ($categories as $category) { // Display the category title echo ‘<h2>’ . $category->name . ‘</h2>’; … Read more

List of published post dates only outputting one date

you are overwriting the $testlist variable in each iteration of the loop. You need to concatenate each date to $testlist instead. please try to fetch all posts from the past year and create a js array containing their dates and make sure to call the test() function where you want this script to be executed … Read more