WordPress theme options tabs

WordPress includes many js libraries in \wp-includes\js and in wp-admin\js. You can browse through them and choose which one you want, including jQuery tabs. You can use it in your theme by using this function, http://codex.wordpress.org/Function_Reference/wp_enqueue_script To figure out how to use the tabs, you would read about it here: http://jqueryui.com/demos/tabs/

How to use permalink query to go to specific tabs in posts

I’ve found out the solutions, though not perfect, but it gets the job done. Following is the code add_action(‘init’, ‘my_init’); function project_ace2_init() { global $wp; $wp->add_query_var(‘tab’); // Needed so get_query_var(‘tab’) will work add_rewrite_rule( //'(.+?)/([^/]+)(/([^/]+))?/?$’, //Original : ‘(.+?)/([^/]+)(/[0-9]+)?/?$’ ‘((?:(?!page|tag|category|author|search|feed|type))[^/]+)/([^/]+)(/([^/]+))?/?$’ ‘index.php?category_name=$matches[1]&name=$matches[2]&tab=$matches[4]’, ‘top’ ); } The rule is taken from the default WordPress rules for permalink as /%category%/%postname%/, … Read more

Tabbed navigation in widget backend

I checked the markup and core WordPress code to find out how it handles categories and came to the conclusion that all the categories are get loaded on page load and at a time either All Categories or Most Used is displayed by manipulating it using jQuery(on mouse click showing and hiding category-pop & category-all … Read more

Custom Taxonomy + JQuery Tabs

This should work, but it’s not tested <div id=”tabs”> <ul id=”tab-menu”> <?php $terms = get_terms(‘category’); global $wpdb; $posts = array(); if ( is_array($terms) && ! empty($terms) ) { $active = null; foreach ( $terms as $i => $term ) { $ids = $wpdb->get_col( $wpdb->prepare(“SELECT object_id FROM $wpdb->term_relationships WHERE term_taxonomy_id = %d”, $term->term_taxonomy_id )); $articles_count = … Read more

Site-wide tabs at WordPress website?

Depends on where you want it, but the first thing that comes to mind is to simply add it in either header.php or footer.php in your theme. This is especially simple if the content won’t change often – just add the code to your theme files. If it’s content you want to change often, then … Read more

How to get related posts and wp comments under tabs

You need to use do_shortcode() for the shortcode to actually work inside PHP function add_post_content($content) { if(!is_feed() && !is_home()) { $above=”<p></p>”; $content_of_first_tab = ‘A list of related posts ‘; $args= array( ‘number’ => ‘5’, ‘post_id’ => get_the_ID(), // use post_id, not post_ID. ); $comments = get_comments( $args ); $output=””; foreach ( $comments as $comment ) … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)