R
R
Roman Fear2021-11-02 13:52:56
WordPress
Roman Fear, 2021-11-02 13:52:56

How to output shortcode of another plugin via acf in php wp?

Now used in the template is this line

<?php echo do_shortcode('[slide-anything id=928644]'); ?>


I want to make it so that it is possible to change the id of the slider through the WordPress editor, I made a field like text in the ACF
In the template I wrote this
<?php echo do_shortcode(the_field('Sa_Slider')); ?>

In the editor I write [slide-anything id=928644]
I don't get a slider in the output, but just the text "[slide-anything id=928644]"
Help fix this, thanks!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Roman Fear, 2021-11-02
@Kypidon4ik

Decision

<?php if(get_field('Sa_Slider'))
echo do_shortcode(''.get_field('Sa_Slider').'');?>

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question