Site slogan

There's an option for a site slogan in the heading area in the BerryPro theme settings, but it doesn't display. How do I add a slogan then?
Shirley

Comments

user
Submitted by admin on Mon, 08/31/2015 - 15:06

BerryPro theme will display only logo in header area.
So, site slogan text should be included in the logo image.

user
Submitted by shirleyborrett on Wed, 09/02/2015 - 23:43

OK, I'll try adding slogan to the logo image. But could I change one of the template files to display a slogan?
Shirley

user
Submitted by admin on Thu, 09/03/2015 - 05:21

Yes, you can. Logo code in mentioned in includes/header.php

<?php if ($logo): ?>
<a href="<?php print $front_page; ?>" title="<?php print t('Home'); ?>" id="logo">
<img src="<?php print $logo; ?>" alt="<?php print t('Home'); ?>" />
</a>
<?php endif; ?>
user
Submitted by shirleyborrett on Thu, 09/03/2015 - 09:30

Thanks, I've found /includes/header.php and below the logo code are these lines relating to the slogan:

<?php
 
if (theme_get_setting('site_slogan')):
?>
<?php
 
endif;
?>

This obviously gives the slogan an identity but doesn't render it to the page. My understanding of php is not great, but I'm guessing I need to add something like this before the endif?

<?php
 
print render($site_slogan['site_slogan']);
?>

But clearly I've not got the code/syntax right, because it still doesn't display. What would be the correct code?

thanks
Shirley

user
Submitted by admin on Thu, 09/03/2015 - 09:53

Please follow below steps:

  1. Open /includes/header.php in any text editor
  2. Find Following code:
    <?php if ($logo): ?>
    <a href="<?php print $front_page; ?>" title="<?php print t('Home'); ?>" id="logo">
    <img src="<?php print $logo; ?>" alt="<?php print t('Home'); ?>" />
    </a>
    <?php endif; ?>
  3. Change above code to:
    <?php if ($logo): ?>
    <div id="logo">
    <a href="<?php print $front_page; ?>" title="<?php print t('Home'); ?>">
    <img src="<?php print $logo; ?>" alt="<?php print t('Home'); ?>" />
    </a><br />
    <?php print $site_slogan; ?>
    </div>
    <?php endif; ?>
  4. Save header.php

Done!!

user
Submitted by shirleyborrett on Thu, 09/03/2015 - 13:02

Thanks, that works. Now I can use CSS to theme and position the slogan.