WordPress.org

Ready to get started?Download WordPress

Forums

Hybrid Hook
How to add Google+ code to homepage only (1 post)

  1. Jon
    Member
    Posted 1 year ago #

    I think this would be helpful to more people than just myself.

    I am trying to get the Google+ code to be inserted in my wordpress homepage, but I cannot seem to either get my php correct from a syntax standpoint, or place it in the correct Hybrid Hook section. Can someone please assist?

    Google+ wants to add some secret HTML code onto ONLY your home page. I have tried to paste variations of code (and checked/unchecked the execute php box) into various sections of the Hybrid Hook Plugin Setting page, but cannot get it to write the code out into just the home page.

    Any suggestions for me? It seems like it should be so simple...
    What am I missing? I do have other PHP code executing properly from within this plugin.

    Code I cannot get working.....have tried many tweaks to this basic code, but none seem to work..............

    <?php if (is_front_page() || (is_home() || (is_page(123)) {?>
    <div class="Googleplus"> Google+</div>
    <?php }?>

    Sample of code pasted into Hybrid_before_content that works fine....
    <?php if( function_exists('wp_content_slider') && is_front_page() ) { wp_content_slider(); } ?>

    http://wordpress.org/extend/plugins/hybrid-hook/

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.