Adding html code before Content

Community Forums Forums Design Tips and Tricks Adding html code before Content

This topic is: not resolved


This topic contains 2 replies, has 2 voices, and was last updated by  incomeclub 2 years, 11 months ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
  • #7437


    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?



    Bill Murray

    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: or Twitter: @wpperform

    We do managed WordPress hosting.



    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.

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.