onload in tag

Community Forums Forums General Discussion onload in tag

This topic is: not resolved


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

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


    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


    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.


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



    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.


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

You must be logged in to reply to this topic.