WordPress.org

Ready to get started?Download WordPress

Forums

Add 'onload' command to the body class (7 posts)

  1. Michael Klasno
    Member
    Posted 2 years ago #

    OK I am a rookie and need a little guidance
    I have a cgi program that rotates images.

    I NEED to add this >>>> onLoad="loadrandoms()"
    TO THIS
    <body class="<?php hybrid_body_class(); ?>">

    Any help would be appreciated
    Michael

  2. That's a very specific question for the Hybrid framework...

    My Theme Hybrid club membership expired (I switched to another theme) but this is a case where that membership fee would be well spent. That's the sort of question that would be quickly answered in Justin Tadlock's forums.

    http://themehybrid.com/club

  3. Michael Klasno
    Member
    Posted 2 years ago #

    OK, then how would I add the onload command here?

    <body <?php body_class(); ?>>

    should it not work the same?
    Michael

  4. alchymyth
    The Sweeper & Moderator
    Posted 2 years ago #

    afaik, 'onload..' gets added to the body tag, not to the body_class:

    http://www.w3schools.com/jsref/event_body_onload.asp

  5. Michael Klasno
    Member
    Posted 2 years ago #

    OK,? but the tutorial you sent me to doesn't tell me anything.

    How do i separate the two? I ASSUME I can't have 2 <Body> tags? so I have to have the CLASS and the ONLOAD inside the BODY TAG, Correct?

    michael

  6. alchymyth
    The Sweeper & Moderator
    Posted 2 years ago #

    so I have to have the CLASS and the ONLOAD inside the BODY TAG, Correct?

    yes - and where is the problem?

    <body <?php body_class(); ?> onLoad="loadrandoms()">

    edit: unless you tell me that you tried it, and it id not work - then I have no idea...

  7. Michael Klasno
    Member
    Posted 2 years ago #

    I tried it that way and it does not work. As stated in the original post I have to use the <body class="<?php hybrid_body_class(); ?>"> along with the onload command.

    the onload command rotates a HERO Picture.

    here is an example where it is working on the html part of my website.
    http://www.goldstardads.org/members/community/

    But I need it to work on the WP portion of the website (root)- right sidebar Meet one of our Heroes - here
    http://goldstardads.org/

    I appreciate your help on this - it is an important part of the website for the members to know that when the public views our site they see our Heroes.

    Michael

Topic Closed

This topic has been closed to new replies.

About this Topic