Tag Archive for 'UI-Tabs'

RGB UI Tabs Fix for WP 2.8+

1 Comment

Sorry guys, I’m very busy right now and have no time to upgrade my themes.
Thanks to Erno Hannink, who found the solution for the problem of RGB UI Tabs under WordPress 2.8:
you need to change this in the header.
Replace this:
jQuery(’#sidebar > ul#ui-tabs’).tabs({ fx: { opacity: ‘toggle’ } });
With:
jQuery(’#sidebar’).tabs({ fx: { opacity: ‘toggle’ } });

jQuery UI Tabs 在 WP 主题中简单应用

4 Comments

jQuery UI Tabs 是一个强大而易用的 jQuery 插件,我无意详细的介绍它,本文只涉及本站当前 WordPress 主题侧边栏中 UI Tabs 的一些简单应用。建议事先阅读相关文档: jQuery UI Tabs/Tabs 3 或 jQuery JavaScript Library 里的 UI/Tabs。
首先,在主题的 header.php 中调用 jQuery 和 UI Tabs,比如(假定所需文件被上传至“主题目录/js/”):
<script src=”<?php bloginfo(‘template_directory’); ?>/js/jquery.js” type=”text/javascript”></script>
<script src=”<?php bloginfo(‘template_directory’); ?>/js/ui.tabs.pack.js” type=”text/javascript”></script>
<script src=”<?php bloginfo(‘template_directory’); ?>/js/ui.tabs.ext.pack.js” type=”text/javascript”></script>
当然你也可以使用 wp_enqueue_script() 来调用 WP 自带的 jQuery 以保证同 WP 插件的兼容性。在 header.php 中,<?php wp_head(); ?> 之前,加入如下代码:

<?php wp_enqueue_script(‘jquery-ui-core’); ?>
<?php wp_enqueue_script(‘jquery-ui-tabs’); [...]