• 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

Adding html code before Content

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 › Adding html code before Content

This topic is: not resolved

Tagged: I

  • This topic has 2 replies, 2 voices, and was last updated 10 years, 3 months ago by incomeclub.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • December 25, 2012 at 11:03 pm #7437
    incomeclub
    Member

    I am using the Eleven40 theme.  I would like to add some html code that is displayed before the content (above the breadcrumb).  How can this be done?

     

    December 26, 2012 at 12:23 am #7441
    Bill Murray
    Member

    There are many ways, but one way would be to...

    1) find the hook that executes near the spot you want to add the markup

    2) write a plugin that contains a function that echos the markup you want to add

    3) in the plugin, use an add_action instruction to add the function you write in #2 to the hook you use in #1

    The plugin route makes it easy if you want to change what you add or change themes.

    Another route would be to use the Genesis Simple Hooks plugin.  The logic using Simple Hooks is the same - activate the Simple Hooks plugin, find the hook and in the metabox for that hook, use PHP commands to echo the markup you want to add.  Be sure to check the box to execute PHP on the hook you select.


    Web: https://wpperform.com or Twitter: @wpperform

    We do managed WordPress hosting.

    December 26, 2012 at 1:48 am #7444
    incomeclub
    Member

    About an hour ago I read about the hooks that are available and I was able to do this with the genesis_before_loop hook.  I am now able to display an ad from Simple Ads Manager just above the first message.

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