ThemeShaper Forums » Thematic

[closed]

How to Change the "Home" Page Link

(5 posts)
  • Started 4 years ago by dk
  • Latest reply from dk
  • This topic is resolved
  1. Hey everyone,

    First off, I'm a huge fan of Thematic, so thanks to Ian and Chris.

    Second, I have a question. It probably has a simple answer, but I'm stumped. I'm still learning PHP and CSS.

    My site: http://davidakennedy.com and http://davidakennedy.com/blog

    My question: How can I get the image header on the blog page to link back to the blog home page (http://davidakennedy.com/blog), instead of the regular home page.

    I basically put it there using one of Ian's prescribed methods: http://forums.themeshaper.com/topic/adding-a-header-image

    I, of course, want to accomplish this without editing Thematic's files.

    Thanks for all the help! I'm looking forward to learning more about Thematic, as I hope to really use it more as a CMS-type theme (along with Wordpress), as well as a blogging theme.

    Posted 4 years ago #
  2. Hi David,

    add the following code to your child theme's function.php:

    function remove_blogtitle() {
    	remove_action('thematic_header','thematic_blogtitle',3);
    }
    add_action('init', 'remove_blogtitle');
    
    function my_blogtitle() {
    	if (is_front_page()) {?>
    	<div id="blog-title"><span><a href="<?php thm_bloginfo('url', TRUE) ?>/" title="<?php thm_bloginfo('name', TRUE) ?>" rel="home"><?php thm_bloginfo('name', TRUE) ?></a></span></div>
    	<?php
    	} else { ?>
    	<div id="blog-title"><span><a href="<?php thm_bloginfo('url', TRUE) ?>/blog/" title="<?php thm_bloginfo('name', TRUE) ?>" rel="home"><?php thm_bloginfo('name', TRUE) ?></a></span></div>
    	<?php
    	}
    }
    add_action('thematic_header','my_blogtitle',3);

    This will keep the link as it is on your front page and change it to ../blog/ on all other pages.

    Chris

    Posted 4 years ago #
  3. Hey Chris,

    Thanks for the help. It's really appreciated.

    Unfortunately, it's not working.

    When I insert the code into my child theme's function file, it only shows the header on the entire site. On the blog home page (davidakennedy.com/blog), the header is clickable, but sends users to this address: http://davidakennedy.com/blog/<br

    I can't figure out why the code isn't working, or why those extra letters are getting inserted into the address.

    Maybe it's conflicting with a plugin? Maybe I asked for what I needed in the wrong way?

    I am going to try to test it on my local machine to see what happens.

    Thanks again for the time and help!

    Posted 4 years ago #
  4. Sorry .. this was my fault! I used a function call that is not included in the latest Thematic release.

    Try:

    function remove_blogtitle() {
    	remove_action('thematic_header','thematic_blogtitle',3);
    }
    add_action('init', 'remove_blogtitle');
    
    function my_blogtitle() {
    	if (is_front_page()) {?>
    	<div id="blog-title"><span><a href="<?php bloginfo('url') ?>/" title="<?php bloginfo('name') ?>" rel="home"><?php bloginfo('name') ?></a></span></div>
    	<?php
    	} else { ?>
    	<div id="blog-title"><span><a href="<?php bloginfo('url') ?>/blog/" title="<?php bloginfo('name') ?>" rel="home"><?php bloginfo('name') ?></a></span></div>
    	<?php
    	}
    }
    add_action('thematic_header','my_blogtitle',3);

    Chris

    Posted 4 years ago #
  5. Works like a charm! Thanks so much for your time and help, Chris. Sincerely appreciated.

    Posted 4 years ago #

RSS feed for this topic

Topic Closed

This topic has been closed to new replies.