Title: Migrating from code-snippet
Last modified: December 5, 2023

---

# Migrating from code-snippet

 *  Resolved [futureyoon](https://wordpress.org/support/users/futureyoon/)
 * (@futureyoon)
 * [2 years, 6 months ago](https://wordpress.org/support/topic/migrating-from-code-snippet/)
 * Hi
 * I am thinking of migrating from code-snippet to your plugin.
 * I was testing one of php scripts that i have but it is not working somehow, maybe
   some lines to be cleaned up, not sure.
 *     ```wp-block-code
       <?php
       add_action( 'wp_head', function () { 
       if (is_page ( array( '93285','93389' ))) {
       ?>
       <script>
   
       	jQuery(document).ready(function() {
   
       		if ((window.pageYOffset) > 74) {	
           		jQuery('header.site-header.site-header--bb').css('background-color','white');		
        		}		
   
       	});
   
       	jQuery(document).ready(function() {
       		window.onscroll = function() {
       			var yposition = window.pageYOffset 	
       			if ((yposition) < 74) { 
       				jQuery('header.site-header.site-header--bb').css('background-color','#ffffff38');			
       			}
       			else {
       				jQuery('header.site-header.site-header--bb').css('background-color','white');		
       			}		
       		}
       	});
       </script>
   
       <style>
       	.site-header {
           background-color: #ffffff38;
       }
       </style>
   
       <?php } });
   
       add_action( 'wp_enqueue_script', function () {
       	wp_enqueue_script( 'jquery' );
       } );
       ```
   
 * Can you guide me what to be adjusted?
 * One suggestion tho
 * Can you add a sample code for each different types (php, javascript, universal,
   html, block..) for beginners like me to get some ideas how it should look like?

Viewing 1 replies (of 1 total)

 *  Thread Starter [futureyoon](https://wordpress.org/support/users/futureyoon/)
 * (@futureyoon)
 * [2 years, 6 months ago](https://wordpress.org/support/topic/migrating-from-code-snippet/#post-17252793)
 * Please disregard this requsest. I have figured something out.

Viewing 1 replies (of 1 total)

The topic ‘Migrating from code-snippet’ is closed to new replies.

 * ![](https://ps.w.org/insert-headers-and-footers/assets/icon-256x256.png?rev=2758516)
 * [WPCode - Insert Headers and Footers + Custom Code Snippets - WordPress Code Manager](https://wordpress.org/plugins/insert-headers-and-footers/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/insert-headers-and-footers/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/insert-headers-and-footers/)
 * [Active Topics](https://wordpress.org/support/plugin/insert-headers-and-footers/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/insert-headers-and-footers/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/insert-headers-and-footers/reviews/)

 * 1 reply
 * 1 participant
 * Last reply from: [futureyoon](https://wordpress.org/support/users/futureyoon/)
 * Last activity: [2 years, 6 months ago](https://wordpress.org/support/topic/migrating-from-code-snippet/#post-17252793)
 * Status: resolved