WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Can I have a different header logo for each page? (12 posts)

  1. ashleyette
    Member
    Posted 4 years ago #

    Hi! I've been Googling everywhere trying to figure out how people are putting different header logos on different pages of their blog using Suffusion. I've just started using WordPress so I'm still learning the ins and outs. I've tried these two plugins: Dynamic Header and GT Unique Header Image and they put my chosen logo image above the Header Foreground Image I chose in the Suffusion Theme Options instead of replacing it. Please show me what I need to do to change the header logo on each page. I LOVE this theme, so I really appreciate your help!

  2. Shane G.
    Member
    Posted 4 years ago #

  3. Jonas Grumby
    Member
    Posted 4 years ago #

    Also you can use Conditional Tags to do this, like on this site:

    http://msgjustice.com

  4. ashleyette
    Member
    Posted 4 years ago #

    Thanks for your suggestions. I tried them, but they didn't work. :( With the plugins, I'm starting to think it's something with the Suffusion theme.
    When I do the following conditional logic, I get both header logos showing up at the same time (after removing the header logo location in the Suffusion theme):

    if(is_page('Blog')){
    echo '<img src="http://ashleysfinds.com/wp-content/uploads/2010/03/header.png" />';
    }
    else(is_page('test')){
    echo '<img src="http://ashleysfinds.com/wp-content/uploads/2010/03/logo.bmp" />';
    }

    If I could get the conditional logic to only show one logo at a time then I'd have what I need. Any thoughts?

  5. Jonas Grumby
    Member
    Posted 4 years ago #

    You probably would want

    else {
       echo

    rather than

    else(is_page('test')){
    echo

    that way any page this is not called Blog shows logo.bmp.

    Also, I'm not sure if it's ok to use the capital B but I know if(is_page('blog')) (i.e. the slug) would ostensibly work.

  6. Jonas Grumby
    Member
    Posted 4 years ago #

    Actually I should say anything that is not a Page called Blog would show logo.bmp.

  7. ashleyette
    Member
    Posted 4 years ago #

    It still shows both images. Now, if I frame that logic with <?php and ?> then it will just show the logo.bmp on both blog and test pages.

    Could it be where I'm putting the logic? Here's my header.php code:

    <?php
    /**
     * Core header file, invoked by the get_header() function
     *
     * @package Suffusion
     * @subpackage Templates
     */
    ?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" <?php language_attributes(); ?>>
    
    <strong><?php
    if(is_page('blog')){
    echo '<img src="http://ashleysfinds.com/wp-content/uploads/2010/03/header.png"
    />';
    }
    
    else {
    echo '<img src="http://ashleysfinds.com/wp-content/uploads/2010/03/logo.bmp" />';
    }
    ?></strong>
    
    <head profile="http://gmpg.org/xfn/11">
    	<meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php bloginfo('charset'); ?>" />
    	<link rel="pingback" href="<?php bloginfo('pingback_url'); ?>" />
    
    <?php
    suffusion_document_header();
    if ( is_singular() ) {
    	wp_enqueue_script( 'comment-reply' );
    }
    wp_head();
    ?>
    
    </head>
    <body>
    
        <?php suffusion_before_page(); ?>
    	<div id="page" class="fix">
    
    		<?php
    			suffusion_before_begin_wrapper();
    
    		?>
    		<div id="wrapper" class="fix">
                    <?php
    			suffusion_after_begin_wrapper();
    
    		?>
    
                    <div id="container" class="fix">
    
    				<?php
    					suffusion_after_begin_container();
    				?>

    Thanks so much!

  8. Sayontan Sinha
    Member
    Posted 4 years ago #

    Ashleyette,
    The call that is building the second image is one of suffusion_before_begin_wrapper() and suffusion_after_begin_wrapper(), depending on what kind of a header display you have selected. These functions are both in actions.php, so if you move your image code to those functions you should be fine.

    Sayontan.

  9. ashleyette
    Member
    Posted 4 years ago #

    Thank you! I'm heading in the right direction now maybe. Now I'm getting this error:

    Warning: Cannot modify header information - headers already sent by (output started at /home/content/37/5760137/html/wp-content/themes/suffusion/functions/actions.php:97) in /home/content/37/5760137/html/wp-includes/pluggable.php on line 868

    I got rid of any white space I could find, but I'm still getting this error. Here are the first 150 lines of code from my actions.php. Any suggestions? I really appreciate your help..this is kicking my tail! :)

    <?php
    /**
     * Contains a list of all custom action hooks and corresponding functions defined for Suffusion.
     * This file is included in functions.php
     *
     * @package Suffusion
     * @subpackage Functions
     */
    
    // First we will get all options from the database, then we will individually invoke the options within each function as required.
    global $options;
    foreach ($options as $value) {
        if (get_option($value['id']) === FALSE) {
        	$$value['id'] = $value['std'];
        }
        else {
        	$$value['id'] = get_option($value['id']);
        }
    }
    
    // Fiddle with some standard hooks
    remove_action('wp_head', 'wp_generator');
    
    //
    // The following section defines different hooks with actions
    
    add_action('wp_print_styles', 'suffusion_disable_plugin_styles');
    
    add_action('suffusion_document_header', 'suffusion_set_title');
    add_action('suffusion_document_header', 'suffusion_include_meta');
    add_action('suffusion_document_header', 'suffusion_include_favicon');
    add_action('suffusion_document_header', 'suffusion_include_default_feed');
    add_action('suffusion_document_header', 'suffusion_include_skin');
    add_action('suffusion_document_header', 'suffusion_include_dbx');
    add_action('suffusion_document_header', 'suffusion_include_featured_js');
    add_action('suffusion_document_header', 'suffusion_include_sidebar_tabs_js');
    add_action('suffusion_document_header', 'suffusion_include_menu_js');
    add_action('suffusion_document_header', 'suffusion_include_jqfix_js');
    add_action('suffusion_document_header', 'suffusion_include_ie_fixes');
    add_action('suffusion_document_header', 'suffusion_include_custom_styles');
    add_action('suffusion_document_header', 'suffusion_include_custom_header_js');
    add_action('suffusion_document_header', 'suffusion_include_custom_js_files');
    
    add_action('suffusion_before_page', 'suffusion_js_initializer');
    
    //add_action('suffusion_before_begin_wrapper', 'suffusion_display_top_navigation');
    add_action('suffusion_before_begin_wrapper', 'suffusion_display_open_header');
    add_action('suffusion_after_begin_wrapper', 'suffusion_display_closed_header');
    
    add_action('suffusion_page_header', 'suffusion_display_header');
    add_action('suffusion_page_header', 'suffusion_display_main_navigation');
    
    add_action('suffusion_page_navigation', 'suffusion_display_hierarchical_navigation');
    
    add_action('suffusion_after_begin_container', 'suffusion_print_widget_area_below_header');
    add_action('suffusion_after_begin_container', 'suffusion_print_left_sidebars');
    
    add_action('suffusion_before_begin_content', 'suffusion_featured_posts');
    add_action('suffusion_after_begin_content', 'suffusion_template_specific_header');
    
    add_action('suffusion_content', 'suffusion_excerpt_or_content');
    
    add_action('suffusion_after_begin_post', 'suffusion_print_post_page_title');
    
    add_action('suffusion_before_end_post', 'suffusion_author_information');
    add_action('suffusion_before_end_post', 'suffusion_post_footer');
    
    add_action('suffusion_before_end_content', 'suffusion_pagination');
    
    add_action('suffusion_before_end_container', 'suffusion_print_right_sidebars');
    add_action('suffusion_before_end_container', 'suffusion_print_widget_area_above_footer');
    
    add_action('suffusion_page_footer', 'suffusion_display_footer');
    
    add_action('suffusion_document_footer', 'suffusion_include_custom_footer_js');
    
    /*
     * The following section says what to do for each action
     */
    function suffusion_document_header() {
    	do_action('suffusion_document_header');
    }
    
    function suffusion_before_page() {
    	do_action('suffusion_before_page');
    }
    
    function suffusion_before_begin_wrapper() {
    	do_action('suffusion_before_begin_wrapper');
    }
    
    if(is_page('blog')){
    echo '<img src="http://ashleysfinds.com/wp-content/uploads/2010/03/header.png"
    />';
    }
    else {
    echo '<img src="http://ashleysfinds.com/wp-content/uploads/2010/03/logo.bmp" />';
    }
    
    function suffusion_after_begin_wrapper() {
    	do_action('suffusion_after_begin_wrapper');
    }
    
    function suffusion_page_header() {
    	do_action('suffusion_page_header');
    }
    
    function suffusion_after_begin_container() {
    	do_action('suffusion_after_begin_container');
    }
    
    function suffusion_before_begin_content() {
    	do_action('suffusion_before_begin_content');
    }
    
    function suffusion_after_begin_content() {
    	do_action('suffusion_after_begin_content');
    }
    
    function suffusion_content() {
    	do_action('suffusion_content');
    }
    
    function suffusion_after_begin_post() {
    	do_action('suffusion_after_begin_post');
    }
    
    function suffusion_before_end_post() {
    	do_action('suffusion_before_end_post');
    }
    
    function suffusion_before_end_content() {
    	do_action('suffusion_before_end_content');
    }
    
    function suffusion_before_end_container() {
    	do_action('suffusion_before_end_container');
    }
    
    function suffusion_page_footer() {
    	do_action('suffusion_page_footer');
    }
    
    function suffusion_document_footer() {
    	do_action('suffusion_document_footer');
    }
    
    function suffusion_page_navigation() {
    	do_action('suffusion_page_navigation');
    }
  10. Sayontan Sinha
    Member
    Posted 4 years ago #

    Move your code to within the functions for suffusion_display_closed_header if you are using a closed header and suffusion_display_open_header if you are using an open header.

  11. ashleyette
    Member
    Posted 4 years ago #

    It worked!! Thank you, Sayontan, for not only creating an amazing theme, but also helping us users get the most out of it!! :)

  12. Valderobi
    Member
    Posted 4 years ago #

    Hi there!!

    I´m just started with WordPress. I´m trying differents themes, and I really liked the Suffusion Theme.
    I would like to have a dynamic header but I don´t find the way to do that with the Dynamic Header plugin (I have all my custom headers uploads in the directory).

    In other themes, I just copy the next code:

    <?php if(function_exists('show_media_header')){ show_media_header(); } ?>

    in the header.php file, and it works, but with the Suffusion Theme, I can´t.
    Could you helpe me to put the code above in the right place, please? I read all the posts of the thread, but I don´t really understand at all.

    My blog is http://www.comicsen8mm.com if you want to see the actual header.
    Thanks a lot.

Topic Closed

This topic has been closed to new replies.

About this Topic