• 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

Make genesis_before_loop hook to work

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 › Design Tips and Tricks › Make genesis_before_loop hook to work

This topic is: resolved

Tagged: ads, adsense, hooks

  • This topic has 2 replies, 2 voices, and was last updated 8 years, 1 month ago by Brad Dalton.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • December 22, 2014 at 12:08 pm #135065
    iamzeus
    Member

    I hava an adsense at below my navigation bar and centered with this hook **genesis_after_header**

    add_action('genesis_after_header', 'topadd');
    function topadd()
    {
    if( is_singular('post') ){
    ?>
    <div class="topadd">
    <div class="wrap">
    ** ADSENSE CODE **
    </div>
    </div>
    <?php
    }
    }

    And it looks like this:
    original

    But I want the add to look like this:
    should look like
    So my add is centered but only above the body part and not including the sidebar.

    While seeing the **[Genesis framework hooks](http://genesistutorials.com/visual-hook-guide/)** it should look like that using any of these hooks: **genesis_before_loop, genesis_loop or genesis_before_entry**

    But any of those gets me this layout look:

    Result

    How do I manage to get the hooks to work?!!?!?!

    December 22, 2014 at 2:09 pm #135071
    iamzeus
    Member

    Hook worked but seems was a css wrongly set for posts

    .single .content .entry in CSS was the solution for the borders

    December 22, 2014 at 11:49 pm #135112
    Brad Dalton
    Participant

    Easier to add a new widget after the header and populate the widget with an Adsense or text widget.


    Get Help – Book Consultation.

  • Author
    Posts
Viewing 3 posts - 1 through 3 (of 3 total)
  • The topic ‘Make genesis_before_loop hook to work’ 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

© 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