Forums

Tabs don't work (Newsport theme) (6 posts)

  1. do77
    Member
    Posted 2 years ago #

    Hi,

    I am using the newsport theme from woo themes and I just can't get the tab section to work. The code looks like this:

    <div id="tabbed">
    
        <ul class="idTabs">
            <li><a href="#pop">Popular</a></li>
            <li><a href="#comm">Latest Comments</a></li>
            <li><a href="#feat">Featured</a></li>
            <li><a href="#tags">Tags</a></li>
        </ul><!--idTabs-->
    
        <div class="content">
    
            <ul id="pop">
                <?php include(TEMPLATEPATH . '/includes/popular.php' ); ?>
            </ul><!--pop-->
    
            <ul id="comm">
                <?php include(TEMPLATEPATH . '/includes/comments.php' ); ?>
            </ul><!--comm-->
    
            <ul id="feat">
                <?php
                    $the_query = new WP_Query('tag=featured&offset=1&showposts=10&orderby=post_date&order=desc');
                    while ($the_query->have_posts()) : $the_query->the_post(); $do_not_duplicate = $post->ID;
                ?>
                <li><a title="Permanent Link to <?php the_title(); ?>" href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?></a></li>
                <?php endwhile; ?>
            </ul><!--feat-->
    
            <div id="tags">
                <?php wp_tag_cloud('smallest=2&largest=20'); ?>
            </div>
        </div><!--content-->
    
    </div><!--tabbed-->

    But when I click on one tab, e.g. popular, the site just scrolls down to the end instead of changing just the tab.

    Any ideas or similar problems?

    Thank you,
    do77

  2. esmi
    Theme Diva & Forum Moderator
    Posted 2 years ago #

    That's because the link on the tab is pointing to a list with the label "pop" further down on the current page. To change this, you'd need to edit the links within the tab section. Perhaps you need to contact support at woothemes?

  3. do77
    Member
    Posted 2 years ago #

    Hi esmi,

    thanks for your response. I also just contacted them but I thought I would get help faster here. What do you exactly mean by 'changing the links within the tab'?

    For example, the Popular tab link to the list id=pop and this one to popular.php.

    <?php
    $pop_posts = get_option('woo_popular_posts');
    if (empty($pop_posts) || $pop_posts < 1) $pop_posts = 5;
    $now = gmdate("Y-m-d H:i:s",time());
    $lastmonth = gmdate("Y-m-d H:i:s",gmmktime(date("H"), date("i"), date("s"), date("m")-12,date("d"),date("Y")));
    $popularposts = "SELECT ID, post_title, COUNT($wpdb->comments.comment_post_ID) AS 'stammy' FROM $wpdb->posts, $wpdb->comments WHERE comment_approved = '1' AND $wpdb->posts.ID=$wpdb->comments.comment_post_ID AND post_status = 'publish' AND post_date < '$now' AND post_date > '$lastmonth' AND comment_status = 'open' GROUP BY $wpdb->comments.comment_post_ID ORDER BY stammy DESC LIMIT ".$pop_posts;
    $posts = $wpdb->get_results($popularposts);
    $popular = '';
    if($posts){
    	foreach($posts as $post){
    		$post_title = stripslashes($post->post_title);
    		$guid = get_permalink($post->ID);
    
    		$custom_field = get_post_meta($post->ID, "image", true);
    ?>
    		<li>
                <a href="<?php echo $guid; ?>" title="<?php echo $post_title; ?>"><?php echo $post_title; ?></a>
        		<div style="clear:both"></div>
            </li>
    <?php
    	}
    }
    ?>

    I am not quite sure what I have to change. It should usually work the way it is...?

    Thanks again,
    do77

  4. esmi
    Theme Diva & Forum Moderator
    Posted 2 years ago #

    <ul class="idTabs">
            <li><a href="#pop">Popular</a></li>
            <li><a href="#comm">Latest Comments</a></li>
            <li><a href="#feat">Featured</a></li>
            <li><a href="#tags">Tags</a></li>
        </ul><
  5. do77
    Member
    Posted 2 years ago #

    Hmm ... I will see what I can figure out. Thanks esmi for your help

    do77

  6. ksenbay
    Member
    Posted 2 years ago #

    Hey do77
    I have exactly the same problem
    could you solve the problem?

    esmi
    I tried what you are saying, like:

    <ul class="idTabs">

  7. <a href="/wp-content/themes/busybee/includes/popular.php
    ">Popular
  8. Latest Comments
  9. Featured
  10. Tags
  11. <

    But Im recieving this error code:

    Fatal error: Call to a member function get_results() on a non-object in /home/ksenbay/kivancsenbay/wp-content/themes/busybee/includes/popular.php on line 5

    Thanks for help in advance...

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags