ThemeShaper Forums » Thematic

[closed]

How to move branding outside of header to above main asides?

(10 posts)
  • Started 7 years ago by timothyd
  • Latest reply from helgatheviking
  • This topic is resolved
  1. timothyd
    Member

    Hello,

    I am currently using a logo image as my title, but would prefer to use the branding. I have removed the header from my site. I would like to move the branding div out of the header and place it above the main asides. After some research I haven't been able to find a post specifically on moving branding outside of the header. I did come across this post with a similar issue and tried using the function provided there, with a little alteration, but I definitely did not do it right.

    Posted 7 years ago #
  2. you don't need to find a "specific" post that covers exactly what you are trying to do. the "process" of adding and removing anything is always the same:

    http://forums.themeshaper.com/topic/need-help-understanding-actions-vs-filters-and-changing-post-meta-and-utility#post-22638

    "with a little alteration, but I definitely did not do it right."

    you'll get a lot more help if you post what you tried and why it didn't work.

    Posted 7 years ago #
  3. timothyd
    Member

    Ok. Would something like this work?

    'function remove_branding(){
    remove_action('thematic_header','thematic_branding',$priority# );
    }
    add_action('init','thematic_branding');
    function thematic_branding(){
    echo "What do I put here?";
    }
    add_action('thematic_abovemainasides','thematic_branding',$priority# );'

    I do not understand what I put in the echo. And is priority number necessary? If so, how do I decide which number?

    Posted 7 years ago #
  4. timothyd
    Member

    Ps. I tried putting the code between back ticks as you instructed me previously, but clearly I didn't do that right either!

    Posted 7 years ago #
  5. you didn't use backticks... i think those are apostrophes. backticks are next to the #1 key (sharing w/ the tilde ~) on my US keyboard anyway.

    i explain priority number in the post i linked you to. it is necessary to remove the function from thematic_header b/c it was added to thematic_header w/ a priority number. it is not necessary to add to above_mainasides unless you are adding multiple functions there and need to control the order.

    you can put whatever you'd like in the

    echo "What do I put here?";

    line.

    you can also browse around in the header-extensions.php file. (but don't make changes there!) you'll see all the functions that hook onto thematic_header. you might want to remove _brandingopen, _blogtitle, _blogdescription, and _brandingclose from the header and relocate them all to simply recreate the title and description

    Posted 7 years ago #
  6. timothyd
    Member

    Ok I tried this:

    function remove_brandingopen(){
    remove_action('thematic_header','thematic_brandingopen', 1 );
    }
    add_action('init','thematic_brandingopen');
    function thematic_brandingopen(){
    echo '<div id=\"branding\">\n';
    }
    add_action('thematic_abovemainasides','thematic_brandingopen', 1 );
    function remove_thematic_blogtitle(){
    remove_action('thematic_header','thematic_blogtitle', 3 );
    }
    add_action('init','thematic_blogtitle');
    function thematic_blogtitle(){
    echo '<div id="blog-title"><span><a href="<?php bloginfo('url') ?>/" title="<?php bloginfo('name') ?>" rel="home"><?php bloginfo('name') ?></a></span></div>';
    }
    add_action('thematic_abovemainasides','thematic_blogtitle', 3 );
    function remove_thematic_blogdescription(){
    remove_action('thematic_header','thematic_blogdescription', 5 );
    }
    add_action('init','thematic_blogdescription');
    function thematic_blogdescription(){
    $blogdesc = '"blog-description">' . get_bloginfo('description');
    			if (is_home() || is_front_page()) {
    	        	echo "\t\t<h1 id=$blogdesc</h1>\n\n";
    	        } else {
    	        	echo "\t\t<div id=$blogdesc</div>\n\n";
    	        }
    }
    add_action('thematic_abovemainasides','thematic_blogdescription', 5 );
    function remove_thematic_brandingclose(){
    remove_action('thematic_header','thematic_brandingclose', 7 );
    }
    add_action('init','thematic_brandingclose');
    function thematic_brandingclose(){
    echo "\t\t</div><!--  #branding -->\n";
    }
    add_action('thematic_abovemainasides','thematic_brandingclose', 7 );

    I took most of the information from the header-extensions.php. I get a syntax error on line 76:

    echo '<div id="blog-title"><span><a href="<?php bloginfo('url') ?>/" title="<?php bloginfo('name') ?>" rel="home"><?php bloginfo('name') ?></a></span></div>';

    Posted 7 years ago #
  7. <duplicate>

    Posted 7 years ago #
  8. syntax error just means that you've messed up the syntax. usually missing a ; } ) or something.

    first you can group all your remove actions together

    function kia_remove_actions(){
    remove_action('thematic_header','thematic_brandingopen', 1 );
    remove_action('thematic_header','thematic_blogtitle', 3 );
    remove_action('thematic_header','thematic_blogdescription', 5 );
    remove_action('thematic_header','thematic_brandingclose', 7 );
    }
    add_action('init','kia_remove_actions');

    next you can't redeclare the same function as in thematic, so i'm surprised you didn't get that error. and if you aren't changing anything about, for example, thematic_brandingopen() why copy it over at all?

    you only need to add the already defined function to a hook

    add_action('thematic_abovemainasides','thematic_brandingopen', 1 );
    Posted 7 years ago #
  9. timothyd
    Member

    Ok that did the trick! Thank you so much!

    function kia_remove_actions(){
    remove_action('thematic_header','thematic_brandingopen', 1 );
    remove_action('thematic_header','thematic_blogtitle', 3 );
    remove_action('thematic_header','thematic_blogdescription', 5 );
    remove_action('thematic_header','thematic_brandingclose', 7 );
    }
    add_action('init','kia_remove_actions');
    add_action('thematic_abovemainasides','thematic_brandingopen', 1 );
    add_action('thematic_abovemainasides','thematic_blogtitle', 3 );

    Should I add branding close? Everything is in place after some css-ing, and working fine.

    Posted 7 years ago #
  10. yes you should add brandingclose. otherwise you are opening a div and not closing it which is bad karma and causes fairies to die.

    glad it is working. don't forget to mark as resolved.

    Posted 7 years ago #

RSS feed for this topic

Topic Closed

This topic has been closed to new replies.