How to add JS script in specific pages in WordPress?

If you’re using IDs for is_page() you should pass them as integers, not strings. Otherwise WordPress is looking for pages with a slug of “3854”, not a page with that ID. So instead of: if ( is_page( array( ‘3854’, ‘253’ ) ) ) {} Use: if ( is_page( array( 3854, 253 ) ) ) {}

Adding markup to sub menu based on class

Here is your code <script> $(document).ready(function(){ $( “.product-menu .sub-menu-level-1” ).after( “<div>SHOW ONCE</div>” ); }); </script> This will automatically add the div if the parent has a class name of product-menu. Let me know if I miss something. and if this solved your issue, give a thumb

How to disable PHP functions in WordPress?

Create a php.ini file for your WP instance and add the disable_functions directive to it. Then, start the PHP server with -c option, such as php -S 127.0.0.1:8001 -c /path/to/php.ini -f /var/www/html/wordpress/.