ThemeShaper Forums » Thematic

[closed]

Adding a class=".." to blog-title

(4 posts)
  • Started 9 years ago by mrsmarshah
  • Latest reply from helgatheviking
  • This topic is resolved
  1. mrsmarshah
    Member

    I know it should be obvious, but I can't seem to wrap my brain around this. I have read through all of the hooks and filter tutorials. I'm new at this, maybe it will just take a few trials until it clicks. I am trying to add a class="Chunkfive" to my blog-title without editing the original files.

    In the end I would like it to look like this:

    <div id="blog-title">
    <span>
    Delicious
    </span>
    </div>

    Posted 9 years ago #
  2. you never edit the original files, that is the whole point of hooks and filters. to do anything you usually need to identify which function is responsible for the thing you want to change or the location of hook you want to add a new function too. In your case (the former) you want to edit the blog title so you need to find the function that creates it. All the functions are in the thematic folder, under extensions. thematic_blogtitle happens to be in the header-extensions.php file... along w/ everything that goes in the header part of a theme (title, description, menu, etc, etc).

    you will need to override (if you are using the latest dev thematic 0.9.7.4) the existing function by dropping this into your functions.php

    function childtheme_override_blogtitle() { ?>
    
    <div id="blog-title"><span class="Chunkfive"><a href="<?php bloginfo('url') ?>/" title="<?php bloginfo('name') ?>" rel="home"><?php bloginfo('name') ?></a></span></div>
    
    <?php }
    
    add_action('thematic_header','childtheme_override_blogtitle',3);

    however- if you look at the original code it already has a span in the blog title so idk why you really need to give it a specific class. you can target it via css just with #blog-title span

    though your question about adding chunkfive as a span and then the end code (which doesnt mention chunkfive) don't jive.. this should help as you can modify the above function anyway you want.

    Posted 9 years ago #
  3. mrsmarshah
    Member

    Thank you Helga! I had no idea it was that simple. I just used CSS #blog-title span and coded it that way. (I was trying to use the @font-face code.) This worked just fine.

    I am using the Thematic Feature Site Child Theme, when I put the code you gave me in my functions file it duplicated my blog title.

    Anyhow, the problem is resolved. Thank you so very much!

    Posted 9 years ago #
  4. i am not familiar w/ that particular child theme, but there was either 1. another instance of

    add_action('thematic_header','somebodys_blogtitle',3); that would need to be removed

    or 2. you are using thematic 0.9.6.2 and so the override logic doesn't apply.

    but either way you were sort of using a 2x4 to swat a fly... glad the css solved the problem.

    Posted 9 years ago #

RSS feed for this topic

Topic Closed

This topic has been closed to new replies.