Title: Nested shortcodes possible?
Last modified: November 20, 2024

---

# Nested shortcodes possible?

 *  Resolved [HJG](https://wordpress.org/support/users/hjg/)
 * (@hjg)
 * [1 year, 6 months ago](https://wordpress.org/support/topic/nested-shortcodes-possible/)
 * Hi there, 
   Im looking for a way to put a shortcode into my ACF custom field [
   nested_shortcode] and with Advanced Views Framework im using the ACF shortcode
   to display my [nested_shortcode] – how is this possible? as of now – im just 
   getting the [nested_shortcode] as text. Chat GPT has been super unhelpful, maybe
   you han help me out.. Question: “can i put a shortcode inside a shortcode , in
   the WordPress plugin “advanced view framework” id like to make an ACF custom 
   field as a shortcode and display it on a post , the custom field will contain
   a shortcode . but now it only diplays the shotcode as the actual shortcode – 
   how do i fix this?”Answer:
 * In WordPress, you can nest shortcodes and process them so that the inner shortcode
   is rendered correctly. The issue you’re experiencing happens because WordPress
   does not automatically process shortcodes within the output of another shortcode.
 * To fix this in the **Advanced View Framework** or any custom WordPress plugin,
   you need to ensure that the output of the outer shortcode is passed through the`
   do_shortcode()` function. Here’s how you can address this:1. **Modify Your Custom
   Shortcode Callback**
 * If you are creating a custom shortcode to display an ACF field, update the callback
   function to process the inner shortcodes. Here’s an example:
 * php
 * Copy code
 * `add_shortcode('acf_field_shortcode', function ($atts) { $atts = shortcode_atts(['
   field' => '', 'post_id' => null, ], $atts); _// Get the ACF field value_ $field_value
   = get_field($atts['field'], $atts['post_id']); _// Process shortcodes within 
   the field value_ return do_shortcode($field_value); });`
 * With this setup:
    - `[acf_field_shortcode field="your_field_name"]` will render the ACF field’s
      value, processing any shortcodes inside it.

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Plugin Author [WPLake](https://wordpress.org/support/users/wplakeorg/)
 * (@wplakeorg)
 * [1 year, 6 months ago](https://wordpress.org/support/topic/nested-shortcodes-possible/#post-18163571)
 * Hi [@hjg](https://wordpress.org/support/users/hjg/)
 * In short, yes Advanced Views can display the shortcode within an ACF Field.
   When
   setting up your ACF field, use the WYSIWYG field type, then in Advanced Views,
   select that field, update or publish your View, and copy the shortcode similar
   to this e.g. [avf_view name=”nested shortcode” view-id=”6746d09c6654e”] into 
   place.Please let me know if this works for you.
 *  Plugin Author [WPLake](https://wordpress.org/support/users/wplakeorg/)
 * (@wplakeorg)
 * [1 year, 4 months ago](https://wordpress.org/support/topic/nested-shortcodes-possible/#post-18223478)
 * We’re closing this ticket as there’s been no reply.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Nested shortcodes possible?’ is closed to new replies.

 * ![](https://ps.w.org/acf-views/assets/icon-256x256.gif?rev=3022872)
 * [Advanced Views - Display Custom Fields (ACF, Pods, MetaBox), Posts, CPT and Woo Products anywhere in Gutenberg, Elementor, Divi, Beaver...](https://wordpress.org/plugins/acf-views/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/acf-views/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/acf-views/)
 * [Active Topics](https://wordpress.org/support/plugin/acf-views/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/acf-views/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/acf-views/reviews/)

 * 4 replies
 * 2 participants
 * Last reply from: [WPLake](https://wordpress.org/support/users/wplakeorg/)
 * Last activity: [1 year, 4 months ago](https://wordpress.org/support/topic/nested-shortcodes-possible/#post-18223478)
 * Status: resolved