Displaying ACF image field [closed]
You can pass the term object as the second parameter to the_field/get_field. echo ‘<img src=”‘ . get_field( ‘brochure_logo’, $tax_term ) . ‘”>’;
You can pass the term object as the second parameter to the_field/get_field. echo ‘<img src=”‘ . get_field( ‘brochure_logo’, $tax_term ) . ‘”>’;
OK had a go at this myself, I didn’t realise ACF was able to add fields to taxonomies which is really handy so I wanted to figure it out too. <?php $libargs=array( ‘hide_empty’ => 0, ‘parent’ => 0, ‘taxonomy’ => ‘library_categories’); $libcats=get_categories($libargs); foreach($libcats as $lc){ $termlink = get_term_link( $lc->slug, ‘library_categories’ ); ?> <a class=”single-library-cat” href=”https://wordpress.stackexchange.com/questions/71287/<?php … Read more
As mentioned in the comments, you are outside of the loop, so get_field will not know the ID. You can use the code below: <?php $meta_description = get_field(‘meta_description’, get_queried_object_id()); if(empty($meta_description)) { $meta_description = ‘This could be an interesting meta description’; } ?> <meta name=”description” content=”<?php echo $meta_description; ?> “/> If you use var_dump() in the … Read more
There are a few steps to create the custom quick edit box and custom column create a custom meta key (assumed that you have 1 already) add custom admin column title and data (assumed that you want to shows the custom meta key in the column, if not, you may also modify a bit of … Read more
Tip 1: do not use qtranslate. I’ve used for years and now I can say that never been money better spent than those for WPML, specially if compared to the work needed to solve problems qT brings. Also consider that WPML is compatible with a huge number of plugins and themes, in years I used … Read more
Unique key for each row in a repeater field
Copying Custom Meta Values from existing post to a duplicate post
Is there a way to export Advanced Custom Fields data?
I don’t use Twig, but I’m fairly sure that you have to pass values rather than all WP functions from the template (which probably runs outside the context of WordPress). So, your controller (typically the WordPress template) will store the results of the WP calls into an array, and then you render the Twig template … Read more
Wouldn’t it be better to have the users fill out the title field and use it as the client name? Woothemes’ testimonials plugin does this. If that’s not an option, you can look into adding a filter on title_save_pre. Haven’t used it myself but here are examples: From StackExchange: Title_save_pre – Simple problem that u … Read more