WordPress Multisite: Programmatically Activate / Deactivate a Plugin of a Specific Blog

Use a combination of switch_to_blog(), activate_plugins(), and deactivate_plugins(). You can put this in functions.php, but you’ll want to remove it once it runs: // hook to admin init add_action(‘admin_init’, ‘wpse_swap_plugins’); function wpse_swap_plugins() { // set blog ID per your needs $blog_id = 3; // switch to the site where you want to activate/deactivate plugins switch_to_blog($blog_id); … Read more

Support information in backend

Take a look at custom dashboard widget usage : https://codex.wordpress.org/Dashboard_Widgets_API https://codex.wordpress.org/Function_Reference/wp_add_dashboard_widget http://www.wpbeginner.com/wp-themes/how-to-add-custom-dashboard-widgets-in-wordpress/ http://wpengineer.com/307/add-wordpress-dashboard-widgets/ I have included the code you need copied from the reference link 3rd link which will allow you to add a custom dashboard widget. Add this to your functions.php and customise as you wish. add_action(‘wp_dashboard_setup’, ‘my_custom_dashboard_widgets’); function my_custom_dashboard_widgets() { global $wp_meta_boxes; wp_add_dashboard_widget(‘custom_help_widget’, … Read more

Submit Form data to another page via Ajax (WordPress Way)

Modify the following code I have added action in it. $(‘#btnDoCalculation’).click(function(e){ var formData = $(‘#interest_calculator’).serialize(); $.ajax({ type: ‘POST’, url: ‘<?php echo admin_url(‘admin-ajax.php’);?>’, data:formData, dataType: ‘json’, action:calculate_investor_interest encode:true, }).done(function(data){ if(data.success){ console.log(data); var results = data.calc_results; var newData = results.reduce(function(collection, element){ var rowData = {}; //create a new empty row element.reduce(function(collection, element){ //put the elements into the … Read more

Overwrite a plugin’s CSS?

You can solve this in two ways No.1 to find the ‘a’ tag with class name ‘ bwg_load_btn_1 bwg_load_btn ‘ in your plugin and add inline style like this <a class=”bwg_load_btn_1 bwg_load_btn” href=”https://wordpress.stackexchange.com/questions/285911/javascript:void(0);” style=”font-size:16px;”>Load More…</a> 2nd in your style.css add font-size for this class with !important, .bwg_load_btn_1.bwg_load_btn{ /* !important will override the style */ font-size:16px … Read more

WHy custom plugin slows down the loading of the pages?

I think no one will give you exact answer why your code is slow. The thing is we don’t know what is inside each file. You have to profile your code. Simplest way to profile code is to use microtime. $time = -microtime(true); // Here exeute code which you want to profile $time += microtime(true); … Read more

Can i add custom code in Source, Header from function.php?

Yes, you can: add_action(‘wp_head’,function() { echo ‘your html here’; }); However your .ico file should be put in a place it can’t be purposely or accidentally deleted, like your theme folder beside your functions.php. Once done you can then use the following to construct the URL: add_action(‘wp_head’,function() { echo ‘<link href=”‘.get_template_directory_uri().’/Buhehe.ico” rel=”shortcut icon” type=”image/x-icon”>’; }); … Read more