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

Reduce size of responsive title

You can add custom CSS where you use media query in order to reduce the font-size of the title in small devices. You also have some styling that remove the line break and add the 3 dots at the end. So you can also remove them. You can try this code : @media all and … Read more

Add Ajax Hooks and Call from Custom Template PHP

may be here is the error add_action( ‘wp_ajax_my_ajax_action’, ‘my_ajax_action_callback’ ); add_action( ‘wp_ajax_nopriv_my_ajax_action’, ‘my_ajax_action_callback’ ); change to add_action( ‘wp_ajax_my_ajax_action_callback’, ‘my_ajax_action_callback’ ); add_action(‘wp_ajax_nopriv_my_ajax_action_callback’,’my_ajax_action_callback’ ); and in ajax change: action : ‘my_ajax_action_callback go to functions.php and add: require(dirname(__FILE__) . ‘/custom_template.php’); make sure your ajax url is correct!!

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

Adding string before php [closed]

<?php echo “Posted: “.human_time_diff( get_the_time(‘U’) ) . __(‘ ago’, ‘yourlanguageslug’); ?><br/> It’s not that hard. but, you should these small things.

execute function after one completed

If you look at the source wp-includes/post.php, then you’ll see that wp_transition_post_status(), which contains transition_post_status, at both occurrences, in wp_insert_post() and wp_publish_post(), is called before the save_post hook. In short, the order is just different than you want it to be.

::before on open/close function [closed]

Your shortcode return text. Wrap return into some HTML, like <div class=”status_text”></div> and style this block. add_shortcode( ‘linestatus’, ‘line_status_handler’ ); function line_status_handler( $atts ) { extract( shortcode_atts( array( ‘open_time’ => ’09:00:00′, ‘closed_time’ => ’17:00:00′, ‘open_text’ => ‘our lines are open’, ‘closed_text’ => ‘our lines are closed’, ), $atts ) ); if ( time() >= strtotime( … Read more