This is searchable archive of our old support forums, which operated from 2012 - 2016. To find out how to get support for your current theme, please visit our support page.

Nested Shortcodes

  • Creator
    Topic
  • #25458
    kennethfeldman
    Participant

    Hi Jason,

    I’ve placed some Accordions inside of tabs.

    They work fine, but there are numerous extra BR’s and P’s.

    It seems that the RAW thing is being fooled by the nested shortcodes.

    Is there any way around this?

Viewing 4 replies - 1 through 4 (of 4 total)
  • Author
    Replies
  • #25461
    Jason Bobich
    Keymaster

    This all isn’t designed to be nested within each other, but paste here your shortcode usage and I’ll try it on my end.

    #25479
    kennethfeldman
    Participant

    Tx!

    [raw]
    [tabs style="closed" nav="pills" tab_1="Grade 6" tab_2="Grade 7" tab_3="Grade 8"]
    [tab_1]
    [accordion]
    [toggle title="Vestibulum id ligula porta"]
    Vestibulum id ligula porta felis euismod semper. Maecenas faucibus mollis interdum. Aenean eu leo quam. Pellentesque ornare sem lacinia quam venenatis vestibulum. Morbi leo risus, porta ac consectetur ac, vestibulum at eros. Etiam porta sem malesuada magna mollis euismod.
    [/toggle]
    
    [toggle title="Maecenas faucibus mollis interdum"]
    Maecenas faucibus mollis interdum. Maecenas sed diam eget risus varius blandit sit amet non magna. Praesent commodo cursus magna, vel scelerisque nisl consectetur et. Donec ullamcorper nulla non metus auctor fringilla. Morbi leo risus, porta ac consectetur ac, vestibulum at eros. Cras mattis consectetur purus sit amet fermentum. Curabitur blandit tempus porttitor.
    [/toggle]
    [/accordion]
    [/tab_1]
    
    [tab_2]
    [accordion]
    [toggle title="Donec sed odio dui"]
    Donec sed odio dui. Cras justo odio, dapibus ac facilisis in, egestas eget quam. Nullam id dolor id nibh ultricies vehicula ut id elit. Nulla vitae elit libero, a pharetra augue. Etiam porta sem malesuada magna mollis euismod. Cras justo odio, dapibus ac facilisis in, egestas eget quam. Aenean lacinia bibendum nulla sed consectetur.
    [/toggle]
    
    [toggle title="Vestibulum id ligula"]
    Vestibulum id ligula porta felis euismod semper. Aenean lacinia bibendum nulla sed consectetur. Sed posuere consectetur est at lobortis. Donec ullamcorper nulla non metus auctor fringilla. Nullam quis risus eget urna mollis ornare vel eu leo.
    [/toggle]
    
    [toggle title="Duis mollis"]
    Duis mollis, est non commodo luctus, nisi erat porttitor ligula, eget lacinia odio sem nec elit. Maecenas sed diam eget risus varius blandit sit amet non magna. Nullam id dolor id nibh ultricies vehicula ut id elit. Cras justo odio, dapibus ac facilisis in, egestas eget quam. Sed posuere consectetur est at lobortis.
    [/toggle]
    
    [/accordion]
    [/tab_2]
    [tab_3]
    [accordion]
    [toggle title="Curabitur blandit tempus porttitor"]
    Curabitur blandit tempus porttitor. Curabitur blandit tempus porttitor. Maecenas faucibus mollis interdum. Sed posuere consectetur est at lobortis.
    [/toggle]
    
    [toggle title="Maecenas faucibus"]
    Maecenas faucibus mollis interdum. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed posuere consectetur est at lobortis. Morbi leo risus, porta ac consectetur ac, vestibulum at eros.
    [/toggle]
    
    [toggle title="Donec ullamcorper"]
    Donec ullamcorper nulla non metus auctor fringilla. Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor auctor. Integer posuere erat a ante venenatis dapibus posuere velit aliquet. Maecenas sed diam eget risus varius blandit sit amet non magna. Aenean lacinia bibendum nulla sed consectetur. Donec sed odio dui.
    [/toggle]
    
    [/accordion]
    
    [/tab_3]
    [/tabs]
    [/raw]
    #25482
    Jason Bobich
    Keymaster

    The [raw] part isn’t relevant here with the nested content because it’s only referring to the top-level content being parsed by WordPress’s default the_content filter. Once you go within, you’re now dealing with the tabs shortcode, itself.

    And the tabs shortcode itself doesn’t have any kind of parameter you can pass to disable the auto formatting of the inner content. Although, if you use the layout builder, you could put the toggle shortcodes within raw tab content, and there’s a checkbox that’ll allow you to disable the auto-formatting.

    With the shortcode setup you have, I don’t really see any good way to filter in and modify this behavior, other than doing this:

    remove_filter( 'themeblvd_the_content', 'wpautop' );

    …. but this will affect many other components of the framework, too, and not just the situation you’re working with.

    #25485
    kennethfeldman
    Participant

    Hi Jason,

    Ahhh! Thank you! I totally forgot that I could make TABS in the layout builder.

    And, that has has worked perfectly now, so thank you once again!

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

You must be logged in to reply to this topic.