• Skip to main content
  • Skip to forum navigation

StudioPress

  • Shop for Themes
  • My StudioPress

Forum navigation

  • Home
  • General Genesis Discussions
  • StudioPress Themes
  • Genesis Blocks
    • Genesis Blocks
    • Genesis Custom Blocks
  • Retired Themes
  • FAQs
  • Forum Rules
  • Internationalization and Translations
  • Forum Bugs and Suggestions
  • Forum Log In

Are You Using The WordPress Block Editor?

Genesis now offers plugins that help you build better sites faster with the WordPress block editor (Gutenberg). Try the feature-rich free versions of each plugin for yourself!

Genesis Blocks Genesis Custom Blocks

Best approach to modify genesis_custom_header_style function

Welcome!

These forums are for general discussion on WordPress and Genesis. Official support for StudioPress themes is offered exclusively at My StudioPress. Responses in this forum are not guaranteed. Please note that this forum will require a new username, separate from the one used for My.StudioPress.

Log In
Register Lost Password

Community Forums › Forums › Archived Forums › General Discussion › Best approach to modify genesis_custom_header_style function

This topic is: resolved
  • This topic has 3 replies, 2 voices, and was last updated 11 years, 3 months ago by SavvyJackie.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • October 2, 2014 at 10:30 am #126560
    lmartins
    Member

    Im trying to get my header image, applied by genesis as a background, to stretch the full width of the layout.
    Sadly I can't force via CSS because Genesis puts a background declaration inline, which gains priority over my background-size css property.

    In lib/structure/header.php, the function genesis_custom_header() is responsible for creating this markup, and the var containing the markup is declared like this:

    
    	//* Header image CSS, if exists
    	if ( $header_image )
    		$output .= sprintf( '%s { background: url(%s) no-repeat !important; }', $header_selector, esc_url( $header_image ) );
    

    To be able to manipulate the image via css, would be as simple as changing it to:

    
    	//* Header image CSS, if exists
    	if ( $header_image )
    		$output .= sprintf( '%s { background-image: url(%s); }', $header_selector, esc_url( $header_image ) );
    

    Although im not really sure how can I approach this. Modifying Genesis code is out of question obviously.

    Can you recommend any approach?

    Thanks.

    October 2, 2014 at 3:03 pm #126580
    SavvyJackie
    Member

    Hi,
    Have you tried this:
    http://coolestguidesontheplanet.com/add-full-width-responsive-header-image/


    Web Designer and Developer at Savvy Jackie Designs | Lucky with plants | @SavvyJackie

    Got your question answered here? Please pay it forward by helping someone else. I’m sure there is at least one question you can answer. 🙂

    October 3, 2014 at 5:13 am #126657
    lmartins
    Member

    Hi,

    That seems to do the trick yes, thank you @SavvyJackie
    Still have to investigate how can I change Genesis functions as mentioned but in this case this solves the issue.

    Thanks again.

    October 3, 2014 at 7:41 am #126665
    SavvyJackie
    Member

    There are a lot code snippets to view on StudioPress Snippets to learn more. Also visit

    You can change the functions through using actions and filters. Also the Genesis Simple Edits and Simple Hooks plugins are helpful.


    Web Designer and Developer at Savvy Jackie Designs | Lucky with plants | @SavvyJackie

    Got your question answered here? Please pay it forward by helping someone else. I’m sure there is at least one question you can answer. 🙂

  • Author
    Posts
Viewing 4 posts - 1 through 4 (of 4 total)
  • The topic ‘Best approach to modify genesis_custom_header_style function’ is closed to new replies.

CTA

Ready to get started? Create a site or shop for themes.

Create a site with WP EngineShop for Themes

Footer

StudioPress

© 2026 WPEngine, Inc.

Products
  • Create a Site with WP Engine
  • Shop for Themes
  • Theme Features
  • Get Started
  • Showcase
Company
  • Brand Assets
  • Terms of Service
  • Accptable Usse Policy
  • Privacy Policy
  • Refund Policy
  • Contact Us
Community
  • Find Developers
  • Forums
  • Facebook Group
  • #GenesisWP
  • Showcase
Resources
  • StudioPress Blog
  • Help & Documentation
  • FAQs
  • Code Snippets
  • Affiliates
Connect
  • StudioPress Live
  • StudioPress FM
  • Facebook
  • Twitter
  • Dribbble