Tutorial Shares
  • Home
  • Tutorials
  • Categories
  • My Favorites
  • Terms of Use
  • WordPress
    • Theme Customizations
    • Security
    • Admin Dashboard
  • Magento
  • Code Snippets
  • Hosting
  • CSS
  • Dev Tools
  • Hosting
    • Hosting
    • Nginx
    • Ubuntu
    • Linux
  • Design
  • PHP

Display different logo on homepage in Magento

Oct 9, 2024 by Christine Cardoso in Magento Loading 686

It is recommended by SEOmoz that the homepage logo be only a h1 tag on the homepage, and h3 on all subsequent internal site pages. In your header.phtml, the default magento template uses getIsHomePage() which allows us to replace

1
<h1 class="logo"><strong><?php echo $this->getLogoAlt() ?></strong><a href="<?php echo $this->getUrl('') ?>" title="<?php echo $this->getLogoAlt() ?>" class="logo"><img width="377px" src="<?php echo $this->getLogoSrc() ?>" alt="<?php echo $this->getLogoAlt() ?>" /></a></h1>

with

1
2
3
4
5
<?php if ($this->getIsHomePage()):?>
    <h1 class="logo"><strong><?php echo $this->getLogoAlt() ?></strong><a href="<?php echo $this->getUrl('') ?>" title="<?php echo $this->getLogoAlt() ?>" class="logo"><img width="377px"  src="<?php echo $this->getLogoSrc() ?>" alt="<?php echo $this->getLogoAlt() ?>" /></a></h1>
<?php else:?>
    <h3 class="logo"><strong><?php echo $this->getLogoAlt() ?></strong><a href="<?php echo $this->getUrl('') ?>" title="<?php echo $this->getLogoAlt() ?>" class="logo"><img width="377px"  src="<?php echo $this->getLogoSrc() ?>" alt="<?php echo $this->getLogoAlt() ?>" /></a></h3>
<?php endif; ?>

Share this:

  • Google
  • Twitter
  • Pinterest
  • Print
  • Email

Recent Posts

  • Take website screenshots from command line on Mac
  • Cut, divide, and trim objects in Illustrator
  • Bidirectional relationship · Issue #28 · CMB2/cmb2-attached-posts
  • Git Subtrees For Trellis Workflow
  • How to Recover Deleted Files in a Mac OS X Terminal | eHow

Community Favorites

  • Custom admin column for WP categories & taxonomies (1334)
  • Show All Categories and their Posts in Wordpress (1302)
  • Add color picker to wordpress admin metafield (1251)
  • Fix nav menu active classes for custom post types (1198)
  • Contact Form 7 + Bootstrap Example (1188)

Tags

archive.php background image bower Categories Category Archives cli composer Customize WP custom metaboxes custom meta fields Custom Page Template Custom Post Type Archives Custom Post Types date DevOps digital ocean frontend git GoDaddy Gulp linux commands load Magento 2 Nginx node.js NPM Page Templates Pagination Password Protect Permalinks Roots.io Roots Theme Sage server admin sysadmin Terminal Theme Customizations trellis typography Ubuntu 14.04 usermod Wordpress Wordpress hacks Wordpress plugins WP Admin Dashboard

© 2017 TutorialShares.com. Brought to you by Digimix, a WordPress Development Company.

loading Cancel
Post was not sent - check your email addresses!
Email check failed, please try again
Sorry, your blog cannot share posts by email.