wp_mail() is not working in localhost

wp_mail() falls back to php’s mail() function which requires a configured MTA (Message Transfer Agent) on your host. So either you install and configure such a MTA. If you’re running a Linux like OS, SSMTP is an easy solution on which you can use any mail-provider to send your system mails via SMTP. Another MTA … Read more

Why is my ajax call refreshing the page?

Try using preventDefault(), it’s a jQuery function for preventing default actions called by the browser. First you should call an event handler by firing up your submitter. You can do this as follow: $(‘#my_upload_form’).submit(function (event) { After catching a submit and giving an event with it, you should prevent the default refresh of a browser: … Read more

WordPress shortcodes & performance

You need to look at this from a couple of perspectives and then you have to weigh the odds against each other In general, shortcodes will be slower (we are talking milliseconds here) as they need to be parsed and processed by the shortcode handler. USAGE: [my_shortcode] in post editor Shortcodes in general are quite … Read more

Does Quantity of files in a plugin affect performance?

You’re worrying too much about something that doesn’t mean much. WordPress doesn’t care how many PHP files you have; the PHP interpreter does. And the PHP interpreter really doesn’t care about the number of files until it actually accesses those files and executes the code. And for all purposes, the interpreter doesn’t access a file … Read more

Exclude custom post_type in sitemap generation?

If you are using functions.php script to register custom post type, you should declare false to ‘has_archive’ => true,. function custom_post_type() { $labels = array( … ); $args = array( // you have to set it to False. ‘has_archive’ => false, ); register_post_type( ‘post_type’, $args ); } add_action( ‘init’, ‘custom_post_type’, 0 );

I need to Remove this line

This happens when you check that sneaky checkbox while installing WordPress: Discourage search engines from indexing this site To disable it, simply head over to Settings > Reading and disable the above checkbox. If this is being added to your theme’s header by a third party plugin, then it’s not easy to answer.

Add query string to plugin URL

When you don’t know if query string was started or not you can use add_query_arg which it knows how to deal with that and adds the “?” or “&” marks (which ever one is needed) to the query string. Update By popular demand I’m adding a few examples that are from the codex: Using get_permalink: … Read more