ThemeShaper Forums » Thematic


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

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

    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">

    Posted 11 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 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 }

    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 11 years ago #
  3. mrsmarshah

    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 11 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 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 11 years ago #

RSS feed for this topic

Topic Closed

This topic has been closed to new replies.