shortcode in or with ACF
-
SO, I’ve done some searches of ACF and shortcodes, including nested shortcodes… but I am not exactly certain what to do with the stuff that I found.
Specifically: I am using the Divi Theme builder and Easy Testimonials.
I have a template, built in Divi, for all of the Books (custom post type) on the site.I want to display a testimonial associated with the specific book currently being displayed. (i.e. on the page for “the surface” I want to display a testimonial for “the surface” (and not for any other book)
The Easy Testimonials plugin allows me to use a shortcode to determine the testimonial to be displayed.
The Content visibility plugin allows me to only display the content field if the ACF field has a value.So, in the divi module, I would add the shortcode.
— single_testimonial id=”1835″ theme=”clean_style” width=”100%” show_title=”0″ use_excerpt=”0″ reveal_full_content=”0″ show_thumbs=”0″ show_date=”1″ show_other=”1″ hide_view_more=”0″ output_schema_markup=”1″ show_rating=”stars” —or this version
— random_testimonial theme=”clean_style” width=”100%” category=”nightshade” count=”2″ show_title=”0″ use_excerpt=”0″ reveal_full_content=”0″ show_thumbs=”0″ show_date=”1″ show_other=”1″ hide_view_more=”0″ output_schema_markup=”1″ show_rating=”stars” —In the first case, I would specify the *ID* (1835) in an ACF field.
In the second case, I would specific the category valueIn either case — I need, somehow, to put the ACF value into the middle of the testimonial short code.
One “answer” indicated
echo do_shortcode( ‘[contactform id=”‘.get_field(‘contact_form’).'”]’ );
but that is PHP. I don’t think I’m allowed to run php within a text-field in the WordPress post front-end… am I?Another said:
[acf field=”name”]
THIS, I understand…. but I cant put the acf shortcode INSIDE the testimonial shortcode.Alternatively, I guess I could include the whole testimonial shortcode within an ACF field… but that appears to not work without tweaking as well.
Suggestions or answers are welcome.
The page I need help with: [log in to see the link]
- The topic ‘shortcode in or with ACF’ is closed to new replies.