WordPress.org

Ready to get started?Download WordPress

Forums

WP UI - Tabs, Accordions, Sliders
[resolved] How about adding the tabs in theme files? (4 posts)

  1. vbk100
    Member
    Posted 2 years ago #

    How about adding the tabs directly to theme files rather than in posts/pages? I want to use them in header.php or sidebar.php

    Thank you !

    http://wordpress.org/extend/plugins/wp-ui/

  2. kavingray
    Member
    Plugin Author

    Posted 2 years ago #

    Hi Bharath, sorry for the late reply, there is something wrong with this forum's feed and now we have got a forum there.

    Yes you can use the tabs in your sidebar, though the header.php can be bit over complicated.

    Sidebar

    Shortcodes are already enabled on the sidebar Widgets, by wp-ui. If that somehow doesn't work, append this to the theme's function.php.

    add_filter( 'widget_text', do_shortcode' );

    Now you can use the shortcodes in the text widget :)

    Header.php

    You can use the tabs shortcode as and where applicable, with echo do_shortcode().

    // shortcode with all the arguments.
    $tabstart = '[wptabs style="ui-lightness"]';
    
    echo do_shortcode( $tabstart );
    
    // the title, content, and closing shortcodes follow.

    But that procedure looks rather repelling, right? I am thinking about including some functions to make this simple.

    Please let me know,
    Kavin

  3. vbk100
    Member
    Posted 2 years ago #

    Hello Kavin ,

    Thanks for your kind help !

    sorry for the late reply, there is something wrong with this forum's feed and now we have got a forum there.

    You did a right thing shifting from phpBB to Vanillaforums. BTW, There were some of my posts at your old forums which were not published (The forum was Moderation based).. So I started posting here :)

    Yes you can use the tabs in your sidebar, though the header.php can be bit over complicated.

    I have already tried the tabs in 'text' widgets and successfully able to publish. I failed to use the code in header.php .Any how I will follow the echo do_shortcode() in header.php and will update you

    Thanks again !

  4. kavingray
    Member
    Plugin Author

    Posted 2 years ago #

    Hai Bharath,

    First stuff first -
    If you would like to show only the posts, you can ditch the header.php and take on index.php. You can create like 4-5 custom loops and add them to tabs.

    Also i recommend that you take a look at the file "wp-ui-dev.js" under plugins/wp-ui/js/, if you are comfortable with the code . Implementing the tabs are down right simple. :)

    Thanks for the kind words. Yep, i decided to switch to vanilla, main reason it being simple and straight forward.
    I am sorry about the lost forum posts. I had the forum backup with the vanilla import tool, but it ignored some posts, no idea why, for that i made sure there were no posts under moderation. Sorry for the inconvenience.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags