Change directory of javascript files

go to your themes functions.php and find line 122. You will find navigation.js function. get_template_directory_uri() . ‘/js/navigation.js and change it to get_template_directory_uri() . ‘assets/js/navigation.js do it again for skip-link-focus-fix.js code located on line 124. For customizer go and find customizer.php in ‘inc’ folder. Go line 53 and change js/customizer.js code to assets/js/customizer.js Don’t forget to … Read more

Insert a button on a page with random number generation

all thing you have to do is use javaScript function JavaScript Example: var random_number = function(){ return Math.floor(Math.random() * 10000) + 1; }; document.getElementById(‘button_text’).onclick = function () { document.getElementById(“input_box”).innerHTML = random_number(); }; jQuery Example: $.randomBetween(0,10000);

WXR slicing script

Googling for “split wxr file” returned several results, including python script for splitting .wxr file GUI for splitting WXR files (OSX and Windows) .Net splitter for WXR files Haven’t tried any of these, but the comments look positive.

Add stylesheets and js to template files when shortcode is used

put wp_enqueue_script() in your shortcode handler. add_shortcode(‘myshortcode’, ‘my_shortcode_handler’); function my_shortcode_handler($atts) { wp_enqueue_script(‘my-script’, plugins_url(‘my-script.js’, __FILE__), array(‘jquery’), ‘1.0’, true); // actual shortcode handling here return “bacon flavored shortcode here”; } this definitely loads the my-script.js file for me. it gets loaded in the footer though. i don’t think there is a way for it to load conditionally … Read more

change $src from wp_register_script in plugins/themes

Well of course you can. All you need to find is what handle they are using for those scripts. let’s say they are uing plugin-script handle. Then you deregister and register script again with your URL. Like this. function wcs_scripts_styles() { wp_deregister_script( ‘plugin-script’ ); wp_register_script( ‘plugin-script’, get_stylesheet_uri(). ‘/js/jquery.script.js’, array( ‘jquery’ ), NULL, true ); } … Read more

Overwrite or Replace code in WP_Footer

Since you ruled out remove_action there is only one way you can do it. And you’ve guessed it: preg_repalce, substr mixture but with a little help and PHP DOM add_action(‘wp_footer’, ‘my_start_footer_ob’, 1); function my_start_footer_ob() { ob_start(“my_end_footer_ob_callback”); } add_action(‘wp_footer’, ‘my_end_footer_ob’, 1000); function my_end_footer_ob() { ob_end_flush(); } function my_end_footer_ob_callback($buffer) { // remove what you need from he … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)