1

I need the text seen in light gray at the top of the header to be below the site title/tagline but above the tabbed navigation:

devtest.lcnlit.org

I would prefer learning to do it the proper way (calling it in a function?), but I will use hard-coding if I have to. I currently have the text hardcoded under cryout-branding-hook, but I don't really understand what all of the hooks in the header do, so can't figure out where to properly place the text in my child theme header.

Thank you for your help.

Here is the header.php file:

<?php
/**
 * The Header
 *
 * Displays all of the <head> section and everything up till <div id="main">
 *
 * @package Cryout Creations
 * @subpackage mantra
 * @since mantra 0.5
 */
 ?><!DOCTYPE html>
<html <?php language_attributes(); ?>>
<head>
<title><?php wp_title( '', true, 'right' ); ?></title>
<meta http-equiv="Content-Type" content="text/html; charset=<?php bloginfo( 'charset' ); ?>" />
<?php   cryout_seo_hook(); ?>
<link rel="profile" href="http://gmpg.org/xfn/11" />
<link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>" />
<?php
    cryout_header_hook();
    wp_head(); ?>
</head>
<body <?php body_class(); ?>>

<?php cryout_body_hook(); ?>

<div id="wrapper" class="hfeed">

<?php cryout_wrapper_hook(); ?>

<header id="header">

        <div id="masthead">

            <div id="branding" role="banner" >

                <?php cryout_branding_hook();?>
                <div id="blurb"> LCN provides ABE (adult basic education), ESOL (English for Speakers of other languages), and GED instruction at little or no cost to adult learners in our community. If you need instruction or would like to be a volunteer tutor, please call 610-292-8515.</div>
                <div style="clear:both;"></div>

            </div><!-- #branding -->

            <nav id="access" class="jssafe" role="navigation">

                <?php cryout_access_hook();?>

            </nav><!-- #access -->

        </div><!-- #masthead -->

    <div style="clear:both;"> </div>

</header><!-- #header -->
<div id="main">
    <div  id="forbottom" >
        <?php cryout_forbottom_hook(); ?>

        <div style="clear:both;"> </div>

        <?php cryout_breadcrumbs_hook();?>
1

Well, unless the theme is doing something weird with the hook, all you should need is:

function my_branding() { ?>
  <div id="blurb"> LCN provides ABE (adult basic education), ESOL (English for Speakers of other languages), and GED instruction at little or no cost to adult learners in our community. If you need instruction or would like to be a volunteer tutor, please call 610-292-8515.</div>
  <div style="clear:both;"></div><?php
}
add_action('cryout_branding_hook','my_branding');

You may have to track down the cryout_branding_hook() function to see exactly what the function name is and you may also have to track down the function for debugging if things are weird. As this is a theme specific function and hook, I'm guessing about a lot of things.

1

Each of the hook functions in the header are places where you can inject your own code. According to this Cryout Creations help page, the cryout_branding_hook() function looks like this, assuming they built the Mantra theme similar to the Tempera theme.

function cryout_branding_hook() {
    do_action(‘cryout_branding_hook’);
}

Do action is a standard WordPress function. To add an action to this, you'd place the following code inside functions.php.

function my_branding() { 
    ?>
    <div id="blurb"> LCN provides ABE (adult basic education), ESOL (English for Speakers of other languages), and GED instruction at little or no cost to adult learners in our community. If you need instruction or would like to be a volunteer tutor, please call 610-292-8515.</div>
    <div style="clear:both;"></div>
    <?php
}

add_action('cryout_branding_hook','my_branding', 11);

The '11' in the add_action call is a declaration of priority. Ten is default, so by setting it to eleven, it will probably happen after the tagline. But, if it ends up happening in the wrong place, you can raise or lower that number, as needed. Here's a nice tutorial by WooThemes on hooks.

Ideally, you should build a Child Theme and put your code there, rather than the base theme's functions file. Otherwise, you run the risk of loosing your customizations, when the theme gets updated. But, that's a bit more advanced.

  • Thanks so much. I modified the function.php file. It does indeed insert that text into the header, but the text stays at the top of the header no matter what I change the '11' to, so not sure what to do next. I am doing it in a child theme, though, so if we ever figure it out, it's safe from updates :) – terrytek Oct 20 '15 at 22:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.