WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

We've started using the Post UI Tabs pluggin but would like to be able to arbitrarily set the tab that is active when the page is loaded. For instance, in one example, we have a three-week process, each week being it's own tab and a fourth tab for resource information, and would like to default the week 3 tab to be active.

Thanks, Tony

share|improve this question

When using Post UI tabs plugin its a bit tricky to set the default tab but not that hard, you need to create your own JavaScript file and put it in your themes folder , lets say you call it custom_script.js inside it add:

   $("#tabs-1").tabs("select",  - 2);

this is assuming that you don't have more then one set of tabs on that post/page. then add this snippet to your themes functions.php file:

function my_tabs_script(){
    if (is_page('SLUG')){
        wp_register_script( 'my_tabs', get_bloginfo('template_directory') . '/custom_script.js',array('jquery','post-ui-tabs'), '1.0' ,true);
        wp_enqueue_script( 'my_tabs' );

this will only load your newly created script on a page with the slug of SLUG you can use it on posts by changing is_page('SLUG') to is_single(''SLUG_OR_ID)

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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