• 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

trying to add adsense to header–not working

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 › trying to add adsense to header–not working

This topic is: not resolved

Tagged: ad, adsense, header

  • This topic has 1 reply, 1 voice, and was last updated 11 years, 4 months ago by angryretailbanker.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • March 11, 2015 at 9:27 am #144011
    angryretailbanker
    Member

    So I'm trying to add an Adsense ad to my blog. I've done it before with the 20/14 theme, and I'm trying to do it with Genesis. I already know how to do it insofar as adding the Adsense code to the header.php coding. But I'm trying to add it to a specific place (under the title/logo-that-I-still-have-to-create, above the menus. It doesn't work, no matter where I put it.

    The only place I can put it is at the very top, above my title, and to the far left. That looks terrible and puts me at risk of accidentally clicking on my own ads, which is a big no-no. I also know that, in the coding, you want to put it between scripts denoted by the symbols "<" and ">". The entire header is one big script, with the only script break putting it in the aforementioned top left corner. Just figuring I'd save you guys some time there.

    So, any advice on how to do this? The code looks something like this normally:

    <?php
    /**
    * Genesis Framework.
    *
    * WARNING: This file is part of the core Genesis Framework. DO NOT edit this file under any circumstances.
    * Please do all modifications in the form of a child theme.
    *
    * @package Genesis\Templates
    * @author StudioPress
    * @license GPL-2.0+
    * @link http://my.studiopress.com/themes/genesis/
    */

    do_action( 'genesis_doctype' );
    do_action( 'genesis_title' );
    do_action( 'genesis_meta' );

    wp_head(); //* we need this for plugins
    ?>
    </head>
    <?php
    genesis_markup( array(
    'html5' => '<body %s>',
    'xhtml' => sprintf( '<body class="%s">', implode( ' ', get_body_class() ) ),
    'context' => 'body',
    ) );
    do_action( 'genesis_before' );

    genesis_markup( array(
    'html5' => '<div %s>',
    'xhtml' => '<div id="wrap">',
    'context' => 'site-container',
    ) );

    do_action( 'genesis_before_header' );
    do_action( 'genesis_header' );
    do_action( 'genesis_after_header' );

    genesis_markup( array(
    'html5' => '<div %s>',
    'xhtml' => '<div id="inner">',
    'context' => 'site-inner',
    ) );
    genesis_structural_wrap( 'site-inner' );

    Thanks in advance, guys!

    http://angryretailbanker.com
    March 11, 2015 at 10:18 am #144028
    angryretailbanker
    Member

    Actually, I want the ad to be to the right of the title, but either way I am still having an issue.

  • Author
    Posts
Viewing 2 posts - 1 through 2 (of 2 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

© 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