WordPress.org

Ready to get started?Download WordPress

Forums

Re-direct blog title to custom URL rather than 'home' (5 posts)

  1. katebutler
    Member
    Posted 4 years ago #

    Hi, I'd like to solve a navigation problem by directing clicks on the blog title to a link that is not the home page.

    If think I've found the right piece of code in the header.php -

    <?php if ( is_home() ) { ?><?php bloginfo('name'); ?> | <?php bloginfo('description'); ?><?php } ?>

    What do I need to change to direct clicks to -

    http://myblog.com/category/news/

    Hope you can help and thanks a million!
    Kate x

  2. Samuel B
    moderator
    Posted 4 years ago #

  3. katebutler
    Member
    Posted 4 years ago #

    Thanks Samuel, that's a really useful plugin. It's not quite what I'm looking for though. I shall try to explain a bit better!

    I'm trying to figure how visitors to my site can be directed to a page/post other than the home page when clicking the blog title.

    I'm using the WPFolio theme which has the option to activate a sidebar if you use a category like 'blog' or 'news'.

    When visitors navigate away from the news page, I'd like them to be able to return by clicking the blog title.

    I'm still quite new to all this so I hope I'm making sense!
    Thanks again.
    Kate x

  4. Samuel B
    moderator
    Posted 4 years ago #

    when clicking the blog title

    I am a bit confused. When you say "blog" title - you are speaking of posts? or your blog page with posts?

  5. erikshosting
    Member
    Posted 4 years ago #

    Your looking for the line that says something like this:
    <a href="<?php bloginfo('url'); ?>" title="<?php _e('Back to Home', TEMPLATE_DOMAIN); ?>"><?php _e('Home', TEMPLATE_DOMAIN); ?></a>

    see it grab the site url dynamically? via bloginfo('url') ?
    what its doing is a normal html href link, but instead of having the addresses between the "" on href= part, they drop php inbetween the " marks.

    what you would do for the above code to make the 'home' button go to my website would be this:

    <a href="http://example.com" title="<?php _e('Back to Home', TEMPLATE_DOMAIN); ?>"><?php _e('Home', TEMPLATE_DOMAIN); ?></a>

    see how I removed the dyanamic call <?php bloginfo('url'); ?> and just put in my web address?

Topic Closed

This topic has been closed to new replies.

About this Topic