onload in tag

Community Forums Forums General Discussion onload in tag

This topic is: not resolved

Tagged: 

This topic contains 2 replies, has 2 voices, and was last updated by  leepettijohn 6 months, 1 week ago.

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

    leepettijohn
    Participant
    Post count: 14

    Hi all,
    Can anyone tell me why sometimes the following functions.php code works and sometimes it doesn’t in different themes and how to fix when it doesn’t. Thanks

    add_filter( 'body_class', 'my_body_class' );
    function my_body_class( $classes ) {
    $classes[] = ' onLoad=”SetToToday(‘FirstSelect’);” ';
    	return $classes;
    }
    

    Refer to this post for more info

    http://trolleyhaus.com/pages/rates-amenities/
    #100750

    Susan
    Moderator
    Post count: 9255

    As you posted this a while ago, I hope you got your issue resolved. If not, please let me know, and I will take a look (or escalate if I cannot help).

    If it is resolved, please mark it resolved, so that the thread can be closed.

    Thanks!


    Susan @ Graphically Designing I offer theme customizations I tweet!
    I’ve taken up the challenge! – help me answer some of the unanswered posts

    #100928

    leepettijohn
    Participant
    Post count: 14

    I got the issue to work, but I added this to the “Header and Footer Scripts” in the Genesis Theme Settings.
    <script type="text/javascript">SetToToday('FirstSelect');</script>

    If there is an answer to the reason different themes work differently, I would love to know.

    Thanks.

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

You must be logged in to reply to this topic.