Adding html code before Content

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

This topic is: not resolved

Tagged: 

This topic contains 2 replies, has 2 voices, and was last updated by  incomeclub 1 year, 8 months ago.

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

    incomeclub
    Participant
    Post count: 7

    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?

     

    #7441

    Bill Murray
    Participant
    Post count: 575

    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.

    #7444

    incomeclub
    Participant
    Post count: 7

    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.