WordPress.org

Ready to get started?Download WordPress

Forums

bring focus to page element (4 posts)

  1. jaschulz
    Member
    Posted 4 years ago #

    As I understand it, header.php is loaded last when the user moves to a new page. So, since I want, each time a page is loaded, to being the focus to an element (which exists on all my pages), I presume what I need to do is add a php call to the header, but I know very little about php, and I have no idea what that function should look like.

    Any help would be appreciated.

    Thanks,

    JAS

  2. esmi
    Forum Moderator
    Posted 4 years ago #

    As I understand it, header.php is loaded last when the user moves to a new page.

    Um... no it isn't. It's the second file that is loaded from your theme (functions.php being the first as far as I recall).

  3. jaschulz
    Member
    Posted 4 years ago #

    Well, in any case, the following does NOT do what I need:

    <body onload="document.getElementById('myElement').focus();" >

    Any ideas about what would work?

    Thanks,

    JAS

  4. esmi
    Forum Moderator
    Posted 4 years ago #

    You might be best starting here.

Topic Closed

This topic has been closed to new replies.

About this Topic