WordPress.org

Ready to get started?Download WordPress

Forums

Best Practices - inserting conditional element in header (2 posts)

  1. marenm
    Member
    Posted 3 years ago #

    Hello,

    I am relatively new to PHP and would like to know the best way to conditionally add an HTML element and script to the header.php file of my custom theme.

    I've done a lot of searching around and most of the tutorials out there seem really roundabout and impractical.

    Basically, I'd like to add an HTML 5 canvas element (and then a processing.js script) to the header of my theme on the HOME page only.

    Does anyone have thoughts on this? Can maybe point me in the right direction? I'm a little bit confused about filters and hooks, but that seems like the best way to do it.

  2. marenm
    Member
    Posted 3 years ago #

    Oops, sorry, I think this in the wrong forum

Topic Closed

This topic has been closed to new replies.

About this Topic