functions.php code and Genesis Simple Hooks

Community Forums Forums General Discussion functions.php code and Genesis Simple Hooks

This topic is: resolved

This topic contains 2 replies, has 2 voices, and was last updated by  eduardomachuca 2 years, 8 months ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
  • #29473


    I remembered a question I always forget to ask. When someone says “just copy the following code into your theme’s functions.php file”, if I’m using the Genesis Simple Hooks plugin, where exactly should I copy it instead? And do I need to enable the Execute PHP on this hook option?

    I’m currently adding code to the functions.php file on the Modern Portfolio theme, but wonder if that code would disappear during a future theme upgrade. Thus, I’d rather use the genesis simple hooks.



    Eduardo Machuca




    It really depends on the code. Not all code can go into the Genesis Simple Hooks plugin. If it is supposed to do something in admin it will not work. If it is an action that adds some functionality to the front end of the site, you may just need a part of it. For example:

    add_action( ‘genesis_before_content’, ‘child_before_content’ );
    function child_before_content() {
        echo ‘This is before the #content div';

    You could put this into the genesis_before_content hook in the Genesis Simple Hooks plugin

    <?php echo ‘This is before the #content div'; ?>

    It will do the same thing. Then again, since I’m just outputting HTML there you could just add this too

    This is before the #content div

    Ultimately it is something that would have to be modified a bit on a per instance case though, not something that can be covered with “add this to ‘x’ hook and you will be fine every time.”



    Clarified. Thanks for your prompt answer!

    Eduardo Machuca

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

You must be logged in to reply to this topic.