Shortcode under a Shortcode Multiple times Possible?Hide/disable sidebar using shortcode?Shortcode returns values in the wrong orderHow to use author meta in shortcode?esc_attr not working in shortcodeHow to add a dvi tag to a shortcode then change a generated text using jQueryPHP Running On CMS Side of WordpressShortcode to do math with url variablescustom post type category count shortcode

When would open interest equal trading volume?

Can Brexit be undone in an emergency?

Who are the people reviewing far more papers than they're submitting for review?

Should I inform my future product owner that there is a good chance that a team member will leave the company soon?

How do you determine which representation of a function to use for Newton's method?

What exactly is a web font, and what does converting to one involve?

How to convey to the people around me that I want to disengage myself from constant giving?

Strength of Female Chimpanzees vs. Male Chimpanzees?

Can a Druid Wild Shaped as a horse use Horseshoes of Speed?

MySQL - How to check for a value in all columns

Is it safe to unplug a blinking USB drive after 'safely' ejecting it?

Can I separate garlic into cloves for storage?

What the did the controller say during my approach to land (audio clip)?

(How long) Should I indulge my new co-workers?

Is a global DNS record a security risk for phpMyAdmin?

Does rpcpassword need to be non-obvious in bitcoind?

Account creation and log-in system

Carroll's interpretation of 1-forms

Why does Canada require a minimum rate of climb for ultralights of 300 ft/min?

Is this adjustment to the Lucky feat underpowered?

Cemented carbide swords - worth it?

Do household ovens ventilate heat to the outdoors?

Problem of Induction: Dissolved

Does Mage Hand give away the caster's position?



Shortcode under a Shortcode Multiple times Possible?


Hide/disable sidebar using shortcode?Shortcode returns values in the wrong orderHow to use author meta in shortcode?esc_attr not working in shortcodeHow to add a dvi tag to a shortcode then change a generated text using jQueryPHP Running On CMS Side of WordpressShortcode to do math with url variablescustom post type category count shortcode






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








1















[shortcode]
[shortcode1 title="variable text"] Some text[/shortcode1]
[shortcode1 title="variable text"] Some text[/shortcode1]
[shortcode1 title="variable text"] Some text[/shortcode1]
[shortcode1 title="variable text"] Some text[/shortcode1]
[shortcode1 title="variable text"] Some text[/shortcode1]
[shortcode1 title="variable text"] Some text[/shortcode1]
[/shortcode]


Based on the need for a shortcode an HTML parts needs to be repeated based on user/admin inputs. I have presented a format. Is the above a possibility?



Can a shortcode be published within a shortcode multiple times?




Further explanation of the situation Future reader may find it helpful→ This is the edifice of an HTML (Hypothetical example)



<div class="classone">
<div class="classtwo">
<div class="classthree">
<ul class="four">
<li class="question">
<h3>Question</h3>
</li>
<li class="answer">
<p>Answer</p>
</li>
</ul>
</div>
</div>
</div>


This part is repetitive and Inner shortcode →



<li class="question">
<h3>Question</h3>
</li>
<li class="answer">
<h3>Question</h3>
</li>


I think the code for the external shortcode will be written like this →



function external_shortcode()
ob_start();
?>
<div class="classone">
<div class="classtwo">
<div class="classthree">
<ul class="four">
<!-- This is the place where I want the inner shortcode many time -->
</ul>
</div>
</div>
</div>
<?php
return ob_get_clean();

add_shortcode( 'shortcode', 'external_shortcode' );


Code for the Inner shortcode →



function internal_shortcode($atts, $content = null)
$data = [
'title' => 'Some heading text goes here.',
];
$values = shortcode_atts($data, $atts);
ob_start();
?>
<li class="question">
<h3><?php echo esc_attr($values['title']); ?></h3>
</li>
<li class="answer">
<p><?php echo $content; ?></p>
</li>
<?php
return ob_get_clean();

add_shortcode( 'shortcode1', 'internal_shortcode' );









share|improve this question
































    1















    [shortcode]
    [shortcode1 title="variable text"] Some text[/shortcode1]
    [shortcode1 title="variable text"] Some text[/shortcode1]
    [shortcode1 title="variable text"] Some text[/shortcode1]
    [shortcode1 title="variable text"] Some text[/shortcode1]
    [shortcode1 title="variable text"] Some text[/shortcode1]
    [shortcode1 title="variable text"] Some text[/shortcode1]
    [/shortcode]


    Based on the need for a shortcode an HTML parts needs to be repeated based on user/admin inputs. I have presented a format. Is the above a possibility?



    Can a shortcode be published within a shortcode multiple times?




    Further explanation of the situation Future reader may find it helpful→ This is the edifice of an HTML (Hypothetical example)



    <div class="classone">
    <div class="classtwo">
    <div class="classthree">
    <ul class="four">
    <li class="question">
    <h3>Question</h3>
    </li>
    <li class="answer">
    <p>Answer</p>
    </li>
    </ul>
    </div>
    </div>
    </div>


    This part is repetitive and Inner shortcode →



    <li class="question">
    <h3>Question</h3>
    </li>
    <li class="answer">
    <h3>Question</h3>
    </li>


    I think the code for the external shortcode will be written like this →



    function external_shortcode()
    ob_start();
    ?>
    <div class="classone">
    <div class="classtwo">
    <div class="classthree">
    <ul class="four">
    <!-- This is the place where I want the inner shortcode many time -->
    </ul>
    </div>
    </div>
    </div>
    <?php
    return ob_get_clean();

    add_shortcode( 'shortcode', 'external_shortcode' );


    Code for the Inner shortcode →



    function internal_shortcode($atts, $content = null)
    $data = [
    'title' => 'Some heading text goes here.',
    ];
    $values = shortcode_atts($data, $atts);
    ob_start();
    ?>
    <li class="question">
    <h3><?php echo esc_attr($values['title']); ?></h3>
    </li>
    <li class="answer">
    <p><?php echo $content; ?></p>
    </li>
    <?php
    return ob_get_clean();

    add_shortcode( 'shortcode1', 'internal_shortcode' );









    share|improve this question




























      1












      1








      1








      [shortcode]
      [shortcode1 title="variable text"] Some text[/shortcode1]
      [shortcode1 title="variable text"] Some text[/shortcode1]
      [shortcode1 title="variable text"] Some text[/shortcode1]
      [shortcode1 title="variable text"] Some text[/shortcode1]
      [shortcode1 title="variable text"] Some text[/shortcode1]
      [shortcode1 title="variable text"] Some text[/shortcode1]
      [/shortcode]


      Based on the need for a shortcode an HTML parts needs to be repeated based on user/admin inputs. I have presented a format. Is the above a possibility?



      Can a shortcode be published within a shortcode multiple times?




      Further explanation of the situation Future reader may find it helpful→ This is the edifice of an HTML (Hypothetical example)



      <div class="classone">
      <div class="classtwo">
      <div class="classthree">
      <ul class="four">
      <li class="question">
      <h3>Question</h3>
      </li>
      <li class="answer">
      <p>Answer</p>
      </li>
      </ul>
      </div>
      </div>
      </div>


      This part is repetitive and Inner shortcode →



      <li class="question">
      <h3>Question</h3>
      </li>
      <li class="answer">
      <h3>Question</h3>
      </li>


      I think the code for the external shortcode will be written like this →



      function external_shortcode()
      ob_start();
      ?>
      <div class="classone">
      <div class="classtwo">
      <div class="classthree">
      <ul class="four">
      <!-- This is the place where I want the inner shortcode many time -->
      </ul>
      </div>
      </div>
      </div>
      <?php
      return ob_get_clean();

      add_shortcode( 'shortcode', 'external_shortcode' );


      Code for the Inner shortcode →



      function internal_shortcode($atts, $content = null)
      $data = [
      'title' => 'Some heading text goes here.',
      ];
      $values = shortcode_atts($data, $atts);
      ob_start();
      ?>
      <li class="question">
      <h3><?php echo esc_attr($values['title']); ?></h3>
      </li>
      <li class="answer">
      <p><?php echo $content; ?></p>
      </li>
      <?php
      return ob_get_clean();

      add_shortcode( 'shortcode1', 'internal_shortcode' );









      share|improve this question
















      [shortcode]
      [shortcode1 title="variable text"] Some text[/shortcode1]
      [shortcode1 title="variable text"] Some text[/shortcode1]
      [shortcode1 title="variable text"] Some text[/shortcode1]
      [shortcode1 title="variable text"] Some text[/shortcode1]
      [shortcode1 title="variable text"] Some text[/shortcode1]
      [shortcode1 title="variable text"] Some text[/shortcode1]
      [/shortcode]


      Based on the need for a shortcode an HTML parts needs to be repeated based on user/admin inputs. I have presented a format. Is the above a possibility?



      Can a shortcode be published within a shortcode multiple times?




      Further explanation of the situation Future reader may find it helpful→ This is the edifice of an HTML (Hypothetical example)



      <div class="classone">
      <div class="classtwo">
      <div class="classthree">
      <ul class="four">
      <li class="question">
      <h3>Question</h3>
      </li>
      <li class="answer">
      <p>Answer</p>
      </li>
      </ul>
      </div>
      </div>
      </div>


      This part is repetitive and Inner shortcode →



      <li class="question">
      <h3>Question</h3>
      </li>
      <li class="answer">
      <h3>Question</h3>
      </li>


      I think the code for the external shortcode will be written like this →



      function external_shortcode()
      ob_start();
      ?>
      <div class="classone">
      <div class="classtwo">
      <div class="classthree">
      <ul class="four">
      <!-- This is the place where I want the inner shortcode many time -->
      </ul>
      </div>
      </div>
      </div>
      <?php
      return ob_get_clean();

      add_shortcode( 'shortcode', 'external_shortcode' );


      Code for the Inner shortcode →



      function internal_shortcode($atts, $content = null)
      $data = [
      'title' => 'Some heading text goes here.',
      ];
      $values = shortcode_atts($data, $atts);
      ob_start();
      ?>
      <li class="question">
      <h3><?php echo esc_attr($values['title']); ?></h3>
      </li>
      <li class="answer">
      <p><?php echo $content; ?></p>
      </li>
      <?php
      return ob_get_clean();

      add_shortcode( 'shortcode1', 'internal_shortcode' );






      plugins functions shortcode






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited 6 hours ago







      The WP Intermediate

















      asked 8 hours ago









      The WP IntermediateThe WP Intermediate

      8812 gold badges11 silver badges31 bronze badges




      8812 gold badges11 silver badges31 bronze badges























          2 Answers
          2






          active

          oldest

          votes


















          2
















          Yes, you can include a shortcode however many times you like, inside a shortcode. Just make sure you set up the parent shortcode to parse shortcodes nested within.



          So, for example, if your [shortcode] does something like



          function outer_shortcode($content = null) 
          return '<div>' . $content . '</div>';



          just be sure to update it to parse the content for other shortcodes:



          function outer_shortcode($content = null) 
          return '<div>' . do_shortcode($content) . '</div>';



          You can then nest however many duplicate shortcodes as you like inside.






          share|improve this answer

























          • It worked. Thanks a ton.

            – The WP Intermediate
            6 hours ago


















          1
















          Using @WebElaine's example, all you need is to add the do_shortcode($content) to your current code:



          // use both parameters in your function declaration, even if you will ignore the $atts
          function external_shortcode($atts, $content)
          ob_start();
          ?>
          <div class="classone">
          <div class="classtwo">
          <div class="classthree">
          <ul class="four">
          <?php
          // Using do_shortcode will cause Wordpress to output your inner shortcodes.
          do_shortcode($content);
          ?>
          </ul>
          </div>
          </div>
          </div>
          <?php
          return ob_get_clean();

          add_shortcode( 'shortcode', 'external_shortcode' );





          share|improve this answer

























          • Yes, I got it sir.

            – The WP Intermediate
            6 hours ago













          Your Answer








          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "110"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: false,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          imageUploader:
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/4.0/"u003ecc by-sa 4.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          ,
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );














          draft saved

          draft discarded
















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fwordpress.stackexchange.com%2fquestions%2f348408%2fshortcode-under-a-shortcode-multiple-times-possible%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown

























          2 Answers
          2






          active

          oldest

          votes








          2 Answers
          2






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          2
















          Yes, you can include a shortcode however many times you like, inside a shortcode. Just make sure you set up the parent shortcode to parse shortcodes nested within.



          So, for example, if your [shortcode] does something like



          function outer_shortcode($content = null) 
          return '<div>' . $content . '</div>';



          just be sure to update it to parse the content for other shortcodes:



          function outer_shortcode($content = null) 
          return '<div>' . do_shortcode($content) . '</div>';



          You can then nest however many duplicate shortcodes as you like inside.






          share|improve this answer

























          • It worked. Thanks a ton.

            – The WP Intermediate
            6 hours ago















          2
















          Yes, you can include a shortcode however many times you like, inside a shortcode. Just make sure you set up the parent shortcode to parse shortcodes nested within.



          So, for example, if your [shortcode] does something like



          function outer_shortcode($content = null) 
          return '<div>' . $content . '</div>';



          just be sure to update it to parse the content for other shortcodes:



          function outer_shortcode($content = null) 
          return '<div>' . do_shortcode($content) . '</div>';



          You can then nest however many duplicate shortcodes as you like inside.






          share|improve this answer

























          • It worked. Thanks a ton.

            – The WP Intermediate
            6 hours ago













          2














          2










          2









          Yes, you can include a shortcode however many times you like, inside a shortcode. Just make sure you set up the parent shortcode to parse shortcodes nested within.



          So, for example, if your [shortcode] does something like



          function outer_shortcode($content = null) 
          return '<div>' . $content . '</div>';



          just be sure to update it to parse the content for other shortcodes:



          function outer_shortcode($content = null) 
          return '<div>' . do_shortcode($content) . '</div>';



          You can then nest however many duplicate shortcodes as you like inside.






          share|improve this answer













          Yes, you can include a shortcode however many times you like, inside a shortcode. Just make sure you set up the parent shortcode to parse shortcodes nested within.



          So, for example, if your [shortcode] does something like



          function outer_shortcode($content = null) 
          return '<div>' . $content . '</div>';



          just be sure to update it to parse the content for other shortcodes:



          function outer_shortcode($content = null) 
          return '<div>' . do_shortcode($content) . '</div>';



          You can then nest however many duplicate shortcodes as you like inside.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered 8 hours ago









          WebElaineWebElaine

          5,6731 gold badge8 silver badges18 bronze badges




          5,6731 gold badge8 silver badges18 bronze badges















          • It worked. Thanks a ton.

            – The WP Intermediate
            6 hours ago

















          • It worked. Thanks a ton.

            – The WP Intermediate
            6 hours ago
















          It worked. Thanks a ton.

          – The WP Intermediate
          6 hours ago





          It worked. Thanks a ton.

          – The WP Intermediate
          6 hours ago













          1
















          Using @WebElaine's example, all you need is to add the do_shortcode($content) to your current code:



          // use both parameters in your function declaration, even if you will ignore the $atts
          function external_shortcode($atts, $content)
          ob_start();
          ?>
          <div class="classone">
          <div class="classtwo">
          <div class="classthree">
          <ul class="four">
          <?php
          // Using do_shortcode will cause Wordpress to output your inner shortcodes.
          do_shortcode($content);
          ?>
          </ul>
          </div>
          </div>
          </div>
          <?php
          return ob_get_clean();

          add_shortcode( 'shortcode', 'external_shortcode' );





          share|improve this answer

























          • Yes, I got it sir.

            – The WP Intermediate
            6 hours ago















          1
















          Using @WebElaine's example, all you need is to add the do_shortcode($content) to your current code:



          // use both parameters in your function declaration, even if you will ignore the $atts
          function external_shortcode($atts, $content)
          ob_start();
          ?>
          <div class="classone">
          <div class="classtwo">
          <div class="classthree">
          <ul class="four">
          <?php
          // Using do_shortcode will cause Wordpress to output your inner shortcodes.
          do_shortcode($content);
          ?>
          </ul>
          </div>
          </div>
          </div>
          <?php
          return ob_get_clean();

          add_shortcode( 'shortcode', 'external_shortcode' );





          share|improve this answer

























          • Yes, I got it sir.

            – The WP Intermediate
            6 hours ago













          1














          1










          1









          Using @WebElaine's example, all you need is to add the do_shortcode($content) to your current code:



          // use both parameters in your function declaration, even if you will ignore the $atts
          function external_shortcode($atts, $content)
          ob_start();
          ?>
          <div class="classone">
          <div class="classtwo">
          <div class="classthree">
          <ul class="four">
          <?php
          // Using do_shortcode will cause Wordpress to output your inner shortcodes.
          do_shortcode($content);
          ?>
          </ul>
          </div>
          </div>
          </div>
          <?php
          return ob_get_clean();

          add_shortcode( 'shortcode', 'external_shortcode' );





          share|improve this answer













          Using @WebElaine's example, all you need is to add the do_shortcode($content) to your current code:



          // use both parameters in your function declaration, even if you will ignore the $atts
          function external_shortcode($atts, $content)
          ob_start();
          ?>
          <div class="classone">
          <div class="classtwo">
          <div class="classthree">
          <ul class="four">
          <?php
          // Using do_shortcode will cause Wordpress to output your inner shortcodes.
          do_shortcode($content);
          ?>
          </ul>
          </div>
          </div>
          </div>
          <?php
          return ob_get_clean();

          add_shortcode( 'shortcode', 'external_shortcode' );






          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered 6 hours ago









          Mike BaxterMike Baxter

          6514 silver badges9 bronze badges




          6514 silver badges9 bronze badges















          • Yes, I got it sir.

            – The WP Intermediate
            6 hours ago

















          • Yes, I got it sir.

            – The WP Intermediate
            6 hours ago
















          Yes, I got it sir.

          – The WP Intermediate
          6 hours ago





          Yes, I got it sir.

          – The WP Intermediate
          6 hours ago


















          draft saved

          draft discarded















































          Thanks for contributing an answer to WordPress Development Stack Exchange!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid


          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.

          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fwordpress.stackexchange.com%2fquestions%2f348408%2fshortcode-under-a-shortcode-multiple-times-possible%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Invision Community Contents History See also References External links Navigation menuProprietaryinvisioncommunity.comIPS Community ForumsIPS Community Forumsthis blog entry"License Changes, IP.Board 3.4, and the Future""Interview -- Matt Mecham of Ibforums""CEO Invision Power Board, Matt Mecham Is a Liar, Thief!"IPB License Explanation 1.3, 1.3.1, 2.0, and 2.1ArchivedSecurity Fixes, Updates And Enhancements For IPB 1.3.1Archived"New Demo Accounts - Invision Power Services"the original"New Default Skin"the original"Invision Power Board 3.0.0 and Applications Released"the original"Archived copy"the original"Perpetual licenses being done away with""Release Notes - Invision Power Services""Introducing: IPS Community Suite 4!"Invision Community Release Notes

          Canceling a color specificationRandomly assigning color to Graphics3D objects?Default color for Filling in Mathematica 9Coloring specific elements of sets with a prime modified order in an array plotHow to pick a color differing significantly from the colors already in a given color list?Detection of the text colorColor numbers based on their valueCan color schemes for use with ColorData include opacity specification?My dynamic color schemes

          Ласкавець круглолистий Зміст Опис | Поширення | Галерея | Примітки | Посилання | Навігаційне меню58171138361-22960890446Bupleurum rotundifoliumEuro+Med PlantbasePlants of the World Online — Kew ScienceGermplasm Resources Information Network (GRIN)Ласкавецькн. VI : Літери Ком — Левиправивши або дописавши її