Redirect to another page using contact form 7? [closed]

Redirect to another page using contact form 7? [closed]

ACF: post query, hide duplicate values [closed]

You could pass all the fields into an array during your while loop, strip the array of duplicates, and then run a foreach loop on that array. It would look something like this: <?php $designers = array(); while ( $the_query->have_posts() ) : $the_query->the_post(); $designers[] = get_field(‘products_page_designer_name’); endwhile; // This will strip out any values that … Read more

ACF custom field in [closed]

In the header.php template, you cannot access the $post variable. So you will have to map it using $wp_query, as mentioned on ACF forum here. Try this: <?php global $wp_query; $post = $wp_query->post; $background = get_field(‘background’, $post->ID); ?> <style> .site-header { background: url(<?php echo $background; ?>) no-repeat center; background-size: cover; } </style>

ACF add custom fields to categories and display

Check this page out from the ACF docs: https://www.advancedcustomfields.com/resources/get-values-from-a-taxonomy-term/ Specifically this section: “Finding the term related to the current post” <?php // load all ‘category’ terms for the post $terms = get_the_terms( get_the_ID(), ‘category’); // we will use the first term to load ACF data from if( !empty($terms) ) { $term = array_pop($terms); $custom_field = … Read more

Adavnced custom fields relationship query plus query inside

Looks like you’re using both get_posts() and new WP_Query() — You only need one or the other. You’re also using WP_Query() incorrectly — It’s looking for an array of arguments, but you’re passing $videos, which is an array of post objects. Try this: <?php $args = array( ‘post_type’ => ‘videos’, ‘meta_query’ => array( ‘relation’ => … Read more