Mantra child theme – problem with cryout_branding_hook

  • Author
    Posts
  • #38393

    Hi, I’m helping to make some changes in a non-profit society website http://www.rnshs.ca/. We have been using the Mantra theme for some years and are happy with it.
    A couple of days ago I made a child theme for mantra, and put in files style.css and functions.php. I used the enqueue method in functions.php to bring in the main style.css and that works fine, AFAIK. The problem is that when I activated the mantra-child theme, everything looked fine (this is on my localhost, using WAMP) except that the ‘above content’ area remained blank.

    I searched for and tried many things but eventually had to resort to copying header.php to the child folder, and putting in this code:
    ===================================
    <header id=”header”>
    <div id=”masthead”>
    <div id=”branding” role=”banner” >

    <!– jgc 2016.08.14 workaround for the banner image since this (cryout_branding_hook) isn’t working in the child theme. Probably have to do something different in functions.php to ‘enqueue’ *something – but what?
    <?php cryout_branding_hook();?>
    <div style=”clear:both;”></div>
    –>


    <div id=”header-container”>
    </div>
    <div style=”clear:both;”></div>
    </div><!– #branding –>
    ===================================

    This insertion of an explicit link to the desired image worked, as far as I can tell. At least the front page looks the same as the production site.
    I have 2 questions:
    a) why did I have to do this? i.e. is something wrong in the code somewhere?; and
    b) is it possible that something else on the site may be badly affected, that I haven’t noticed yet?

    Thanks,
    John Cordes

    #38398

    Following up on my own post. After more searching of this Forum I eventually found what I think is the answer. Our site is using the header background image, set by WordPress -> Appearance -> Header (I had not appreciated that before). This seems to resolve my problem, so that I no longer need an edited header.php file in the mantra-child directory.
    Apologies for the false alarm.

    John Cordes

    #38495
    Zed
    Cryout Creations mastermind

    Child themes don’t automatically inherit WordPress settings (header image, background image and color, menu associations) from the parent theme. These need to be re-set after activating the child theme.


    If you like our creations, help us share by rating them on WordPress.org.
    Please check the available documentation and search the forums before starting a topic.
    #38498

    Thanks Zed. I believe I have this under control now. It is useful to see your list of settings which don’t get inherited by a child theme. May have more questions later!

Viewing 4 posts - 1 through 4 (of 4 total)

The topic ‘Mantra child theme – problem with cryout_branding_hook’ is closed to new replies.