• 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

could not load custom function to header

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 › could not load custom function to header

This topic is: resolved
  • This topic has 3 replies, 2 voices, and was last updated 9 years, 5 months ago by hp.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • December 14, 2013 at 9:18 am #79036
    hp
    Member
    add_action( 'genesis_header', 'custom_slider' );
    function custom_slider () {
    	if ( is_home() && function_exists( 'soliloquy_slider' ) ) soliloquy_slider( '29' );
    }

    I use above code, but it looks like Genesis didn't load custom_slider function. Did I do anything wrong? Running on WordPress 3.8.

    Thanks.

    December 14, 2013 at 9:35 am #79041
    ramseyp
    Member

    Is your code in your functions.php?

    Add an echo statement so you see if any output is making it to the genesis_header action:

    add_action( 'genesis_header', 'custom_slider' );
    function custom_slider () {
    	echo '<h1>foo</h1>';
    	if ( is_home() && function_exists( 'soliloquy_slider' ) ) soliloquy_slider( '29' );
    }

    If you see "Foo" in the header space, the function is hooking into the action correctly. Are you on your site's homepage ( or blog page, if you have a static page set as the homepage )? Is the slider plugin loaded & working?

    Cheers!

    Pat


    Community • Work • Conversations

    December 14, 2013 at 9:38 am #79044
    hp
    Member

    Yes, it's in functions.php file. And I also just tested like your suggestion and it looks like is_home() is not working. If I delete 'is_home() &&' then the slide can load to all pages.

    Any idea?
    Thanks.

    December 14, 2013 at 10:03 am #79049
    hp
    Member

    Well... read again the difference between is_home and is_front_page, replaced function and it's working now.

  • Author
    Posts
Viewing 4 posts - 1 through 4 (of 4 total)
  • The forum ‘General Discussion’ is closed to new topics and replies.

CTA

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

Create a site with WP EngineShop for Themes

Footer

StudioPress

© 2023 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