Viewing 11 replies - 1 through 11 (of 11 total)
  • Do not edit the theme itself. First create a child theme for your changes.

    What kind of tabs? there is a shortcode button to add tabs if you have the virtue toolkit installed.

    Kadence Themes

    Thread Starter royamathew

    (@royamathew)

    Kadence on new page/post the toolbar inserts the code. But i created a custom form and saved it as a php. There are 3 forms and want to have 3 tabs for the template. Sorry if the question is very basic.
    Thanks

    If you have the forms in php then you can still use the shortcodes just put them in php with a do_shortcode() function around each shortcode.

    So for example:

    <?php echo do_shortcode([tabs]); ?>

    Kadence Themes

    Thread Starter royamathew

    (@royamathew)

    Hi Kadence, I copied this code from some forum on tabs as below
    <?php
    $tmwp = ‘[tabs][tab title=”title1″]
    <p>content
    </p>
    [/tab]
    [tab Title=”title2″]
    <p> add content</p>

    [/tab][/tabs]’;
    echo do_shortcode( $tmwp );
    ?>

    It works. But when i replace the content with forms i have it gives an error
    Parse error: syntax error, unexpected T_STRING in /homepages/..wp-content/themes/virtue/templates/newfile.php on line 110

    the content is a form and has validation in it

    Hey
    That means your forms are breaking the string. can’t really give any advice without seeing the code. My guess is you would be better off not using a variable for the whole page but just running the tab shortcodes through do_shortcode.

    Kadence Themes

    Thread Starter royamathew

    (@royamathew)

    Hi Kadence…I am really new at this. Is code below what you meant

    <?php echo do_shortcode(‘[tabs]’); ?>

    <?php echo do_shortcode(‘[tab title=”Test1″]’); ?>
    <p>Content here</p>
    <?php echo do_shortcode(‘[/tab]’); ?>

    <?php echo do_shortcode(‘[tab title=”Test2″]’); ?>
    <p>Content here</p>
    <?php echo do_shortcode(‘[/tab]’); ?>

    <?php echo do_shortcode(‘[/tabs]’); ?>

    yes, is it working?

    Thread Starter royamathew

    (@royamathew)

    No it does nothing other than add “/tab” at the end of the forms

    ok yeah that would make sense, not sure what I was thinking.. You were on the right track before, just need to get the form to not break your string.

    You could go about this without using the shortcodes I suppose.

    <ul class="nav nav-tabs sc_tabs">
    <li class="active"><a href="#sctab-tab-01">Tab Title 01</a></li>
    </ul>
    <div class="tab-content postclass">
    <div class="tab-pane clearfix active" id="sctab-tab-01">
    Your content here.
    </div>
    </div>

    If that doesn’t go can you send me a link to your site?
    [email protected]

    Thread Starter royamathew

    (@royamathew)

    <div class=”main col-lg-9 col-md-8″ role=”main”>
    <ul class=”nav nav-tabs sc_tabs”>
    <li class=”active”>Title1
    <li class=””>Title2

    <div class=”tab-content postclass”>
    <div class=”tab-pane clearfix active” id=”sctab-tab-01″>
    content

    and it works fine….thanks Ben

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘How to add tabs to a customs php template’ is closed to new replies.