WordPress.org

Forums

[resolved] How to change 'Home' link to website home instead of WP (6 posts)

  1. freakmaster
    Member
    Posted 5 years ago #

    I've messed with the 'general settings' but that only confuses the 'about' hotlink and ends up being an 'error'. What I need to know, basically, is where and how in the code to make the 'Home' hotlink go from my WP page to the front page of my site. Right now, of course, it just reloads the front page of WP. A friend of mine did this for my blog but I don't know how he did it and don't want to bug him again so I'm asking if anyone knows how to do this.

    Thanks,
    Martin

  2. @mercime
    Volunteer Moderator
    Posted 5 years ago #

    What's the code you have in your theme to set up your main navigation? Usually it's in the header.php

  3. ginigma
    Member
    Posted 5 years ago #

    In header.php, look for lines with
    <?php bloginfo('name'); ?> and
    <?php bloginfo('description'); ?>

    You can change the href to whatever location you want.

  4. freakmaster
    Member
    Posted 5 years ago #

    Alright, I know this is lame but with my very limited knowledge of PHP, here's the code containing the php bloginfo. Where would I enter the href parameters? I think I know where but there's no sense in trashing the 'header.php' and having to re-install WP. Always learning you know. Here's the beginning code:

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" <?php language_attributes(); ?>>

    <head profile="http://gmpg.org/xfn/11">
    <meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php bloginfo('charset'); ?>" />

    <?php if(is_home() || is_single() || is_page()) { echo '<meta name="robots" content="index,follow" />'; } else { echo '<meta name="robots" content="noindex,follow" />'; } ?>

    <?php if (is_single() || is_page() ) : if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
    <meta name="description" content="<?php metaDesc(); ?>" />
    <?php csv_tags(); ?>
    <?php endwhile; endif; elseif(is_home()) : ?>
    <meta name="description" content="<?php if(get_option('uwc_site_description')) { echo get_option('uwc_site_description'); } else { bloginfo('description'); } ?>" />
    <meta name="keywords" content="<?php if(get_option('uwc_keywords')) { echo get_option('uwc_keywords'); } else { echo 'wordpress,c.bavota,magazine basic,custom theme,tinkerpriestmedia.com'; } ?>" />
    <?php endif; ?>

    <title><?php wp_title(''); ?><?php if(wp_title('', false)) { echo ' | '; } ?><?php bloginfo('name'); if(is_home()) { echo ' | '; bloginfo('description'); } ?></title>

    <link rel="stylesheet" href="<?php bloginfo('stylesheet_url'); ?>" type="text/css" media="screen" />
    <link rel="alternate" type="application/rss+xml" title="<?php bloginfo('name'); ?> RSS Feed" href="<?php bloginfo('rss2_url'); ?>" />
    <link rel="pingback" href="<?php bloginfo('pingback_url'); ?>" />
    <!--[if IE]>
    <link rel="stylesheet" type="text/css" href="<?php bloginfo('template_url'); ?>/iestyles.css" />
    <![endif]-->
    <!--[if lte IE 6]>
    <script defer type="text/javascript" src="<?php bloginfo('template_url'); ?>/images/pngfix.js"></script>
    <![endif]-->

    <?php if ( is_singular() ) wp_enqueue_script( 'comment-reply' ); ?>
    <?php wp_head(); ?>
    </head>

  5. @mercime
    Volunteer Moderator
    Posted 5 years ago #

    It's the code usually AFTER the <body> tag, with something like wp_list_pages or wp_list_categories ...
    Disregarding above code though, I see that you've found the solution in your website.

  6. freakmaster
    Member
    Posted 5 years ago #

    Well, mercime, since you've seen the site, I've worked on piecing together the proper code and I've discarded the big button in favor of some nice additions to the two menu bars. Everything I needed was in the header.php but I work with this so seldom that it took some searching and general logic to figure it out...not to mention that I don't know php!!! Thanks to you and everyone who tossed their two cents in on this.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.