• 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

Different header ads on different pages

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 › Different header ads on different pages

This topic is: not resolved

Tagged: ads, header

  • This topic has 5 replies, 2 voices, and was last updated 9 years, 6 months ago by Elaine Griffin.
Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • August 2, 2013 at 5:10 am #53706
    Elaine Griffin
    Member

    Hello,
    I'm trying to figure out the easiest way for my client to display different ads on each page, using a Blissful child theme.
    I thought about creating an above header widget area and using widget logic, but that isn't working. Here is the code:

    "<!-- begin ad tag 728x90 ATF -->
    <script type=""text/javascript"">
    //<![CDATA[
    ord=Math.random()*10000000000000000;
    document.write('<script type=""text/javascript"" src=""http://ad.doubleclick.net/adj/taste.aimeebroussard/homepage;tile=1;sz=728x90;pos=top;ord=' + ord + '?""><\/script>');
    //]]>
    </script>
    <noscript><a href=""http://ad.doubleclick.net/jump/taste.aimeebroussard/homepage;tile=1;sz=728x90;pos=top;ord=123456789?"" target=""_blank"" ><img src=""http://ad.doubleclick.net/ad/taste.aimeebroussard/homepage;tile=1;sz=728x90;pos=top;ord=123456789?"" border=""0"" alt="""" /></a></noscript>
    <!-- end ad tag -->"
    

    My thought was to put the js in the header script area and the html in a text widget, but it didn't show up.

    I've never seen ads like these, and the help on the advertisers end is minimal.

    Thanks in advance!
    Elaine

    http://www.aimeebroussard.com
    August 2, 2013 at 5:31 am #53709
    Brad Dalton
    Participant

    I wrote about how to display different header images on different pages.

    How many pages are you needing this for?

    You can use PHP or custom fields.

    This is the hook you could use rather than the genesis_header hook:

    genesis_header_right
    

    Fair bit of work but all tested and works.

    As you can clearly see, if you want to use unique banners on every page, post etc, PHP code isn't the easiest solution.

    The custom fields method enables you to create a custom meta box so you simply paste the js into the box for that specific page and it hooks into the genesis hook and executes in that position.


    Get Help – Book Consultation.

    August 2, 2013 at 5:35 am #53710
    Elaine Griffin
    Member

    Thanks Brad. What she needs is different ads above her header, on up to 7 pages. Her actual header will remain the same on every page.

    August 2, 2013 at 5:37 am #53711
    Brad Dalton
    Participant

    No problem. Simply change the hook to

    genesis_before_header 

    in the code and the conditional tags if using the PHP method otherwise use the hook in a custom function with the custom field.


    Get Help – Book Consultation.

    August 2, 2013 at 5:47 am #53712
    Brad Dalton
    Participant

    Or you could register the scripts and hook them in using

    wp_enqueue_scripts

    I think the custom field method is the best because they can then use it on more pages down the track


    Get Help – Book Consultation.

    August 2, 2013 at 7:57 am #53726
    Elaine Griffin
    Member

    Yes, and that is what I want her to be able to do. I'm trying to work through the custom fields plugin, and I'm confused about how to place them above the header.

  • Author
    Posts
Viewing 6 posts - 1 through 6 (of 6 total)
  • The forum ‘Design Tips and Tricks’ 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