WordPress.org

Support

Support » Plugins and Hacks » [Resolved] how to include file in tab?

[Resolved] how to include file in tab?

Viewing 1 replies (of 1 total)
  • Plugin Author Matt Lowe
    Participant

    @squelch

    Hi arpitap, check out do_shortcode: http://codex.wordpress.org/Function_Reference/do_shortcode

    e.g.

    echo do_shortcode('[tabs][tab title="Tab 1"]First tab[/tab][tab title="Tab 2"]Second tab[/tab][/tabs]');

    Depending on the data structures you’re building you can do something like:

    $sc = '[tabs]';
    
    foreach ($tabsData as $tab) {
        // Obviously this is just an example and you will need to adapt it to suit your data structure(s)
        $sc .= '[tab title="'.$tab->title.'"]'.$tab->content.'[/tab]';
    }
    
    $sc .= '[/tabs];
    
    echo do_shortcode($sc);
Viewing 1 replies (of 1 total)
  • The topic ‘[Resolved] how to include file in tab?’ is closed to new replies.