Title: adding code in multisite function.php
Last modified: October 11, 2022

---

# adding code in multisite function.php

 *  Resolved [snsdragon](https://wordpress.org/support/users/snsdragon/)
 * (@snsdragon)
 * [3 years, 7 months ago](https://wordpress.org/support/topic/adding-code-in-multisite-function-php/)
 * I am trying to add function to autoplay videos in mycred_video hook
    i got this
   code from the forum
 *     ```
       add_filter( 'mycred_video_query_youtube', 'mycred_adjust_youtube_iframe' );
       function mycred_adjust_youtube_iframe( $attr ) {
       	$attr['autoplay'] = 1;
       	return $attr;
       }
       ```
   
 * i am using wordpress multi-site so when i trying to add them on supe-site function.
   php
    i am getting an error ( some can’t communicate error )
 * can you tell me where to add this script in wordpress multisite = i also tried
   using WPCode plugin for the same but didn’t worked

Viewing 4 replies - 1 through 4 (of 4 total)

 *  [A.Tariq](https://wordpress.org/support/users/arsalantariq/)
 * (@arsalantariq)
 * [3 years, 7 months ago](https://wordpress.org/support/topic/adding-code-in-multisite-function-php/#post-16092636)
 * Hi [@snsdragon](https://wordpress.org/support/users/snsdragon/),
 * Thank you for contacting us, Please check on which site myCred has been installed.
   Add the code snippet on the site where myCred is active.
 *  Thread Starter [snsdragon](https://wordpress.org/support/users/snsdragon/)
 * (@snsdragon)
 * [3 years, 7 months ago](https://wordpress.org/support/topic/adding-code-in-multisite-function-php/#post-16093650)
 * Mycred is active sitewide ( Multisite Enable : Every website ) i wanna add the
   above code in one particular blog. I have used the code Snippet plugin but this
   snippet doesn’t seem to work, or i might be adding the code wrongly. Please guide
 *  Thread Starter [snsdragon](https://wordpress.org/support/users/snsdragon/)
 * (@snsdragon)
 * [3 years, 7 months ago](https://wordpress.org/support/topic/adding-code-in-multisite-function-php/#post-16093740)
 * I just added another code snippet via code snippt plugin and it worked perfectly,
   I think the above code might have some error . it’s not auto play youtube video
   on page load
 *  [A.Tariq](https://wordpress.org/support/users/arsalantariq/)
 * (@arsalantariq)
 * [3 years, 7 months ago](https://wordpress.org/support/topic/adding-code-in-multisite-function-php/#post-16098499)
 * [@snsdragon](https://wordpress.org/support/users/snsdragon/),
 * Please try using the below shared Code Snippet:
 *     ```
       add_filter( 'mycred_video_query_youtube', 'mycred_adjust_youtube_iframe' );
       function mycred_adjust_youtube_iframe( $attr ) {
       $attr['autoplay'] = 1;
       $attr['mute'] = 1;
       return $attr;
       }
       ```
   

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘adding code in multisite function.php’ is closed to new replies.

 * ![](https://ps.w.org/mycred/assets/icon-128x128.gif?rev=3512531)
 * [Points Management System For Gamification, Ranks, Badges, and Loyalty Rewards Program - myCred](https://wordpress.org/plugins/mycred/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/mycred/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/mycred/)
 * [Active Topics](https://wordpress.org/support/plugin/mycred/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/mycred/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/mycred/reviews/)

 * 6 replies
 * 2 participants
 * Last reply from: [A.Tariq](https://wordpress.org/support/users/arsalantariq/)
 * Last activity: [3 years, 7 months ago](https://wordpress.org/support/topic/adding-code-in-multisite-function-php/#post-16098499)
 * Status: resolved