ThemeShaper Forums » Thematic

[closed]

Breadcrumbs and Clickable Logo

(9 posts)
  • Started 9 years ago by kgoodman
  • Latest reply from awarner20
  • This topic is resolved
  1. kgoodman
    Member

    Hi -
    Hoping to get some help. This is my first post to the forum. I am using the Feature Site Child Theme.

    1) Clickable Logo in Header:
    Followed Ian's instructions to add logo to header. Header looks great. However, I cannot seem to make logo link back to Home Page. Can someone please help me with what I'm missing. Read all the previous posts regarding this but cannot make heads or tails following all the threads.

    2) Breadcrumbs:
    Have read Yoast breadcrumbs are simpatico with Thematic. Tried the install and followed instructions without success. Yoast forum not helpful. So, where do I add the following code?

    <?php if ( function_exists('yoast_breadcrumb') ) {
    yoast_breadcrumb('<p id="breadcrumbs">','</p>');
    } ?>

    Yoast says to add to thematic templates, but I would rather not do this and cannot figure out how to add it to the child theme function.php. (not a PHP expert).

    Thanks so much, Enjoying Thematic and this useful forum.
    K.N.

    Posted 9 years ago #
  2. kgoodman
    Member

    Um, resolved the Breadcrumbs issue.

    Thanks. Could still use help on logo in header as detailed above.

    Best,
    k.n.

    Posted 9 years ago #
  3. kgoodman
    Member

    Okay, so I resolved the logo issue too.

    Couldn't see the words for the writing on the wall.

    Thanks again. Just took a little more digging.

    K.n.

    Posted 9 years ago #
  4. Hi kgoodman-

    Can you share your solutions so if someone else comes across this thread looking for help they can benefit from your efforts.

    Thanks
    -Gene

    Posted 9 years ago #
  5. kgoodman
    Member

    Sure.

    Clickable Logo:
    Read this post from Sariedota (sorry if I botched sp). It's super easy and works like a charm.
    http://www.cozmoslabs.com/2009/05/28/add-a-header-image-to-thematic-the-easy-way/

    Also read Ian's first post here because it is also very imformative.
    http://forums.themeshaper.com/topic/adding-a-header-image

    Breadcrumbs (with Thematic):
    Use the Yoast Breadcrumbs plugin. You can install & activate it from your wp-admin panel. You don't need to copy/paste any PHP like the yoast site says. Just do it from wp-admin. Once installed, adjust settings as needed, and there is a nice optional checkbox to click if you are using thematic. Easy to modify look with CSS too.

    Best,
    k.n.

    Posted 9 years ago #
  6. Re: Breadcrumbs
    I moved the access menu outside of the header and made it a part of the main div. So the automatic checkbox to activate breadcrumbs produced some problems for me.

    Here's the code in my child theme's function.php to manually call the breadcrumbs:

    //Add Breadcrumb on top of single posts
    function add_joost_breadcrumb($postheader) {
    	if (is_single()) {
    	if (function_exists('yoast_breadcrumb') )
    	$postheader .= yoast_breadcrumb('<p id="breadcrumbs">','
    ');
    	}
    	return $postheader;
    }
    add_action ('thematic_postheader','add_joost_breadcrumb');
    Posted 9 years ago #
  7. Hi all,

    It's been awhile since I've had a chance to get back into the "Thematic swing of things...". I was searching for a solution to my problem and the function above by joeangelo is just what I needed. Thanks!

    I've adapted it just a tad for use with pages instead of posts and it works great. I do have a question regarding this function though and I hope someone here can assist.

    As I said I changed my function to work with pages:

    //Add Joost Breadcrumb on top of single pages (adapted from single posts)
    function add_joost_breadcrumb($postheader) {
    	if (is_page()) {
    	if (function_exists('yoast_breadcrumb') )
    	$postheader .= yoast_breadcrumb('<p id="breadcrumbs">','
    ');
    	}
    	return $postheader;
    }
    add_action ('thematic_postheader','add_joost_breadcrumb');

    This works fine, but one feature I'd like to do is to append a custom link to be used as the "Home" link. In the Yoast plugin settings I have removed the word "Home" from the "Anchor text for the Homepage:" input field as a first step.

    The reason I would like to enter a custom url link is because I need to link to a separate blog on a WPMU install that is being used as the homepage. These breadcrumbs will reside on several sub-blogs.

    Does this make sense?

    Posted 9 years ago #
  8. Hi Adam,

    Its good to see you around :) There's a few things I'll point out. First, your function (which is action hooked) does not need to be passed $postheader. Second, inside your function, Joost's function needs three arguments passed to it... the opening prefix , the closing suffix, and the display parameter. The way you wrote it you only included the prefix. Display needs to be set to false so you can store it in a string without it being echoed.

    function add_joost_breadcrumb() {
    	if ( is_page() ) {
    		if ( function_exists('yoast_breadcrumb') ) {
    			$postheader = yoast_breadcrumb('<p id="breadcrumbs">','</p>', $display = FALSE);
    			$new_postheader = str_replace('http://the-url-you-want-to-replace.com', 'http://the-url-you-want-as-home.com', $postheader);
    		}
    	}
    	echo $new_postheader;
    }
    add_action ('thematic_postheader','add_joost_breadcrumb');

    So we've stored the breadcrumb output in a string and then searched and replaced for the home url. You may need to use preg_replace with a regular expression to make this function work across multiple domains in a MU set up. I think it would go something like this:

    $new_postheader = preg_replace('/<a(.*?)>/', '<a href="http://the-domain-you-want-as-home.com">', $postheader, 1);

    Cheers,
    Gene

    Posted 9 years ago #
  9. Hi Gene,

    Good to "see" you too! Thanks so much for the corrections/additions! I used the preg_replace with the regular expression and it's working fantastic!

    Thanks also for the explanation along the way. Of course I love the assistance, but the more I understand, the better I'll get in the future and the more I'll be able to give back to others:)

    It's been close to a year since this project started and it's not quite done just yet, but as soon as it is, I'll be showing it here as an example of a Thematic implementation across a small MU network.

    Posted 9 years ago #

RSS feed for this topic

Topic Closed

This topic has been closed to new replies.