Different header logo for different pages

This topic has 16 replies, 5 voices, and was last updated 10 years, 1 months ago ago by Eva Kemp

  • Avatar: Hoellwarth
    Hoellwarth
    Participant
    September 22, 2014 at 22:30

    Hi all, as written in the subject I wonder how I can manage to set different logo images for different pages, i.e:

    Home -> Default Logo
    About -> About Logo
    Contact Us -> Contact Us Logo
    and so on…

    Any ideas? I tried some plugins but I didn’t find any working solution. Thanks in advance for your answers.

    Best Regards.

    15 Answers
    Avatar: Robert Hall
    Robert Hall
    Support staff
    September 23, 2014 at 08:03

    Hello,

    Sorry, but in our theme you can add the logo only to the home page and to the fixed menu.
    Navigate to Theme Options -> Header -> Logo image/Logo image for Fixed header.

    Regards,
    Robert Hall.

    Avatar: Hoellwarth
    Hoellwarth
    Participant
    September 23, 2014 at 08:09

    Not even by using conditional tags in header.php?

    Avatar: Robert Hall
    Robert Hall
    Support staff
    September 23, 2014 at 08:30

    Of course, if you have good programming knowledge, you can edit header.php yourself and add logo.
    We recommend you to use Child Theme for this.

    Regards,
    Robert Hall.

    Avatar: Hoellwarth
    Hoellwarth
    Participant
    September 23, 2014 at 21:53

    And this is what I’m trying to do by creating a template for a particular page, built on page.php and named “About”. So my template is customer-about.php. Instead of having get_header(); I wrote get_header(‘about’); because I created a file named header-about.php in which I replaced the etheme_logo(true); with an image. Why it doesn’t work? The website still shows the logo set through Option Tree.

    Avatar: Jack Richardson
    Jack Richardson
    Support staff
    September 23, 2014 at 22:01

    Hello,

    I think it’s more easier to use function is_page(); for condition in original header file.
    For example:

    if( is_page( 'some_page' ) ) {
    // Echo 1st logo variant
    } elseif ( is_page( 'some_another_page' ) ) {
    // Echo 2nd logo variant
    } elseif and so on...
    

    Regards,
    Jack Richardson

    Avatar: Hoellwarth
    Hoellwarth
    Participant
    September 23, 2014 at 22:34

    I’ll try again Jack, probably I wrote something wrong and the code you wrote didn’t work for me. I’ll keep you updated. Thanks for your reply.

    EDIT: Nothing to do Jack, I post my code:

    						<div class="header-logo">
                            <?php if( is_page( 'home' ) ) {
    						echo ('etheme_logo(true)');
    						} else if ( is_page( 'about' ) ) {
    						echo "('<img src=\"<?php bloginfo('template_url'); ?>/images/logo_1.png\" >')";
    						} ?>	
    						</div>
    Avatar: Eva
    Eva Kemp
    Support staff
    September 24, 2014 at 09:21

    Hello,

    Do you still need our help?
    Please let us know.

    Regards,
    Eva Kemp.

    Avatar: Hoellwarth
    Hoellwarth
    Participant
    September 24, 2014 at 10:13

    Yes, please. I posted the code I wrote in header.php but it didn’t work. If you can give a look at it I’d appreciate it a lot. Thanks Eva.

    Avatar: Jack Richardson
    Jack Richardson
    Support staff
    September 24, 2014 at 17:09

    Hello,

    Could you please provide us with wp-admin and FTP credentials in Private Content?

    Regards,
    Jack Richardson

    Avatar: Hoellwarth
    Hoellwarth
    Participant
    September 24, 2014 at 22:53

    Sure, look at private content.

    Please, contact administrator
    for this information.
    Avatar: Hoellwarth
    Hoellwarth
    Participant
    September 26, 2014 at 19:24

    I gave you credentials 2 days ago but I didn’t see any change…

    Avatar: Eva
    Eva Kemp
    Support staff
    September 29, 2014 at 10:22

    Hello,

    Sorry for a long delay.
    Unfortunately we were unable to log in to wp-admin panel using the credentials you provided.
    Please give us the correct link and login details.

    Thank you.
    Regards,
    Eva Kemp.

    Avatar: Olga Barlow
    Olga Barlow
    Support staff
    September 29, 2014 at 13:19

    Hello,

    First of all what is this echo "('<img src=\"<?php bloginfo('template_url'); ?>/images/logo_1.png\" >')"; ?
    You need to add

    <div class="header-logo">
    <?php if( is_page ('Home')){
          echo etheme_logo(); }
          elseif ( is_page('About')) {
          echo "<img src='http://www.claudiofichera.it/wp-content/uploads/2012/06/CF_Title.png'>";
          } ?>
    </div>

    If you want to change main logo, then you need to add it in header-structure file (royal/headers), not in header.php, because if you take a closer look at code in header.php file you’ll see that lines 81-83 display fixed header logo. Also don’t forget to create and use child theme to save your changes and avoid problems with next update.

    Regards,
    Olga Barlow

    Avatar: Hoellwarth
    Hoellwarth
    Participant
    September 29, 2014 at 18:46

    Hello and thanks for answering me:

    The first string was an attempt to write HTML tags inside an ECHO command, including PHP code.

    In any case, of course I created and activated a child theme and I did what you suggested but, unfortunately, it doesn’t work. Have you tried on a local wp install?

    Thanks in advance for your support. Best Regards.

    EDIT: It works! 🙂 thanks Olga for your precious tips!

    Avatar: Eva
    Eva Kemp
    Support staff
    September 29, 2014 at 21:53

    Hello,

    You’re welcome.

    Regards,
    Eva Kemp.

  • Viewing 16 results - 1 through 16 (of 16 total)

The issue related to '‘Different header logo for different pages’' has been successfully resolved, and the topic is now closed for further responses

8theme customization service
We're using our own and third-party cookies to improve your experience and our website. Keep on browsing to accept our cookie policy.