Support

Account

Home Forums Front-end Issues Insert acf field in a shortcode as attribute

Solving

Insert acf field in a shortcode as attribute

  • How i can insert acf WYSIWYG field as attribute of shortcode like meta for example (meta=yes/no” —> subtitle=”yes/no”). Is it possible? Thanks in adavanced for helping me.

    Excuse me for my english

  • Hi @shark1926

    I’m sorry that I don’t quite understand your question. Could you please explain it in more detail. If you can share some screenshots of the issue, that would be great!

    If you want to create a shortcode, please take a look at this documentation: https://codex.wordpress.org/Shortcode_API.

    Thanks!

  • I have a shortcode like this: [recent_posts num=”3″ post_format=”standard” meta=”false” thumb=”true” category=”news” excerpt_count=”0″ custom_class=”recentPotsType2″]

    Could i put a custom field into this shortcode as an attribute like meta or thumb for example?

  • Hi @shark1926

    It depends on how you handle that shortcode and how you want it to work. Please take a look at the link I gave you before to learn more about creating a hook. Also, please check ACF documentation to check how to use it?

    Thanks!

Viewing 4 posts - 1 through 4 (of 4 total)

The topic ‘Insert acf field in a shortcode as attribute’ is closed to new replies.