I'm working on a theme for a framework, and using shortcode to divide the layout, I've found the following problem:

Into a content, I can divide the container into 12 different parts, it also applies for content inside the content (and this is when problem comes), meaning, for sample, if I decide to set 8 and 4 columns, and then the 8 columns I want to divide it into 2 parts, I would need a structure like this:

  [8 columns]
      [content]   <-- PROBLEM IS HERE
          [6 columns]
             half of eight part 1.
          [/6 columns]
          [6 columns]
             half of eight part 2.
          [/6 columns]
  [/8 columns]

  [4 columns]
     some content here
  [/4 columns]

When I try to executed this logic, the second content is not being taken, and is displayed as text.. so... I thought the shortcode into a shortcode logic would work, however... it doesn't work if the SC is the same, in short works this (my code) is not working for me.

 function content_sc($atts, $content = null){
   return '<div class="content">'.do_shortcode($content).'</div>';
 add_shortcode('content', 'content_sc'); 

Any guessing???

Thanks in advanced!!!


Referring to the codex article on shortcodes, you cannot use a shortcode within itself...which is to say that the following is invalid:


you should probably make an inner-content shortcode or something.

  • This is what happens if you try to parse non-regular structures with regular expressions. -.- – Raphael Feb 19 '12 at 11:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.