Support » Fixing WordPress » Different Logos On Different Pages

  • Resolved davidrosen



    was just told to try posting here. i’m trying to make this wordpress theme do an if/then/else type thing for the logo. i’m not a coder or anything but i can follow instructions. so far not getting it though. the original code looks like this:

    <div id="logo">
    <a href="<?php bloginfo('url'); ?>"><img src="<?php echo of_get_option('logo') ?>" alt="" /></a>

    i’d like to make it so that if the page being displayed is the blog (page name is ‘lifestyle-blog’) it will display a different logo (lets say logo2.png) and if its any other page it will just do as the code there says to do (taking the logo from the wordpress logo option and just using that.

    can anyone help me out?


Viewing 4 replies - 1 through 4 (of 4 total)
  • Michael


    Forum Moderator


    <div id="logo">
    <a href="<?php bloginfo('url'); ?>"><img src="<?php if( is_home() ) { echo get_stylesheet_directory_uri() . '/images/logo2.png'; } else { echo of_get_option('logo'); } ?>" alt="" /></a>

    the above code assumes that the ‘blog’ page is the page which is set as posts page (checked with the is_home() conditional tag) and that the logo2.png image is saved in the /images folder of the theme.

    WOW… we are SO close… haha. thanks so much for your response! it definitely works but there’s still a problem…

    the theme i’m using is called Village, and part of the village theme’s documentation specifically states that the “Posts Page” need to just be left blank and not assigned to my blog page. Then my blog page (‘Lifestyle Blog’) just uses a blog theme and it works as a blog…

    So is there any way to edit what you did, becuase it definitely worked to make the logo change on the blog page if i set the “posts page” to my ‘Lifestyle Blog’ page, but then my blog is just a blank page (again because of the theme setup).

    I’m going to also contact the theme creator to see if they have any thoughts on this. I really appreciate your help on this.

    *Blog page uses a Blog “template” i meant to say, not blog theme…

    I GOT IT!!! Haha, sorry I’m so excited cause this is the first complete wordpress site I’ve ever put together and these 2 issues have just been killing me.

    I changed if (is_home() to if (is_page(‘lifestyle blog’) and it works!

    Thanks SO much for your help

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Different Logos On Different Pages’ is closed to new replies.