WordPress.org

Ready to get started?Download WordPress

Forums

StudioPress Duplicate Tabs (12 posts)

  1. vlgee
    Member
    Posted 4 years ago #

    Hi,

    I am using StudioPress theme for my blog I created a new About page, and in the settings, set the main page to go to a static page. The only option it gave me was my About page, so I set it to that, but now when I go to my site, a tab for Home appears, and both the Home tab and About tab go to an identical page.

    I would like my static page to be labeled Home, but that does not seem to be possible. There is no option under Pages to delete this preset home page and replace it. When I go to Pages, it only shows me the About page I created, yet there are two page tabs on the site.

    Has anyone else had this issue? Any ideas how to correct it?

    Thanks

  2. esmi
    Forum Moderator
    Posted 4 years ago #

    The Home link is almost certainly hard coded into your navigation menu and you would need to edit the relevant template file to remove it. I can't give you any more precise details without seeing your site.

  3. vlgee
    Member
    Posted 4 years ago #

    Thanks Esmi, that's what I was afraid of. I barely know how to make simple changes to my CSS stylesheet. I am a little nervous about tinkering with the PHP. My site is http://mylocaljobmarket.com

    Thanks for your help.

  4. esmi
    Forum Moderator
    Posted 4 years ago #

    Try editing header.php and looking for:

    <div id="nav">
    <ul>
    <li><a title="Home" href="<?php bloginfo('url');?>"><span>Home</span></a></li>
    <?php wp_list_pages('title_li=');?>
    </ul>

    and removing the line:

    <li><a title="Home" href="<?php bloginfo('url');?>"><span>Home</span></a></li>

    To keep the tab highlighting, edit style.css and try changing:

    #nav li a span {
    background:transparent url(images/bgtabright.gif) no-repeat right top;
    color:#FFFFFF;
    display:block;
    font-weight:bold;
    line-height:26px;
    margin-left:6px;
    padding-left:5px;
    padding-right:12px;
    text-decoration:none;
    }

    to:

    #nav li a span,#nav li .current_page a span {
    background:transparent url(images/bgtabright.gif) no-repeat right top;
    color:#FFFFFF;
    display:block;
    font-weight:bold;
    line-height:26px;
    margin-left:6px;
    padding-left:5px;
    padding-right:12px;
    text-decoration:none;
    }
  5. vlgee
    Member
    Posted 4 years ago #

    Ok, thank you so much. I will try that!

    Thanks

  6. vlgee
    Member
    Posted 4 years ago #

    I did not find a line like the one you posted. What it has is

    <div id="nav">
    <?php function get_the_pa_ges() {
      global $wpdb;
      if ( ! $these_pages = wp_cache_get('these_pages', 'pages') ) {
         $these_pages = $wpdb->get_results('select ID, post_title from '. $wpdb->posts .' where post_status = "publish" and post_type = "page" order by ID');
    
       }
      return $these_pages;
     }
    
     function list_all_pages(){
    
    $all_pages = get_the_pa_ges ();
    foreach ($all_pages as $thats_all){
    $the_page_id = $thats_all->ID;
    
    if (is_page($the_page_id)) {
      $addclass = ' class="current_page"';
      } else {
      $addclass = '';
      }
    $output .= '<li' . $addclass . '><a href="'.get_permalink($thats_all->ID).'" title="'.$thats_all->post_title.'"><span>'.$thats_all->post_title.'</span></a></li>';
    }
    
    return $output;
     }
    ?>
    <ul>
    <?php
    
    if (is_home()) {
      $addclass = ' class="current_page"';
      } else {
      $addclass = '';
      }
    echo "<li" . $addclass . "><a href='" . get_option('home') . "' title='Home'><span>Home</span></a></li>";
    echo list_all_pages();?>
    </ul>
  7. vlgee
    Member
    Posted 4 years ago #

    Does anyone have any ideas on how to fix the duplicate page issue?

    Thanks

  8. eivindvr
    Member
    Posted 4 years ago #

    I have the same problem!
    did ypu solve it??

    e

  9. eivindvr
    Member
    Posted 4 years ago #

    Hi!

    I managed to remove the dublicated tab.
    I changed the header.php

    <?php
    if (is_home()) {
      $addclass = ' class="current_page"';
      } else {
      $addclass = '';
      }
    echo "<li" . $addclass . "><a href='" . get_option('home') . "' title='Home'><span>home</span></a></li>";
    echo list_all_pages();?>

    to:

    <?php wp_list_pages('title_li=&depth=1'); ?>

    But it changed the colour on the remaining buttons to blue.
    I havent been able to change them back to white just yet.

    Best Eivind

  10. eivindvr
    Member
    Posted 4 years ago #

    Now I found the propper solution!!!!!:-)
    You should of course just delete the link....Im such a noob:-)

    Find this part of the header.php

    <?php
    if (is_home()) {
      $addclass = ' class="current_page"';
      } else {
      $addclass = '';
      }
    echo "<li" . $addclass . "><a href='" . get_option('home') . "' title='Home'><span>home</span></a></li>";
    echo list_all_pages();?>

    and delete the link:

    <a href='" . get_option('home') . "' title='Home'><span>home</span></a>

    YAY:-)

  11. bmose14
    Member
    Posted 4 years ago #

    That worked great for me!

    Your new code in header.php should look like this:

    <ul>
    <?php
    
    if (is_home()) {
      $addclass = ' class="current_page"';
      } else {
      $addclass = '';
      }
    echo "<li" . $addclass . "></li>"; //change 'Home'
    echo list_all_pages();?>
    </ul>
  12. natedigby21
    Member
    Posted 4 years ago #

    I esmi's instructions, it worked fine with me. Thanks for the replies. I didn't even there're a lot of options for this problem.

    Nate
    Credit Card

Topic Closed

This topic has been closed to new replies.

About this Topic