Settings to get the most out of W3 Total Cache

I’ve seen many more complaints about W3TC than WP Super Cache: WordPress › WP Super Cache « WordPress Plugins. W3TC loads the .htaccess file with many directives and tends to conflict with server side settings. With Super Cache, try PHP caching and follow the instructions to add an .htaccess file to the cache directory: http://wordpress.org/extend/plugins/wp-super-cache/installation/ … Read more

How to solve ‘Eliminate render-blocking JavaScript and CSS in above-the-fold’ content for multiple files?

put this code at the end of functions.php add_action(‘customize_register’, ‘customizer’); function defer_parsing_of_js ( $url ) { if ( FALSE === strpos( $url, ‘.js’ ) ) return $url; if ( strpos( $url, ‘jquery.js’ ) ) return $url; return “$url’ defer “; } add_filter( ‘clean_url’, ‘defer_parsing_of_js’, 11, 1 );

How to properly insert a stylesheet in wp_head

You can do it like this, put it in your functions.php : This is the correct way of doing it “the WordPress way”. <?php // Check if function exisits if (!function_exists(‘rg_templateScriptSetup’)) { // if not, create one function rg_templateScriptSetup() { // Register styles in WordPress wp_register_style(‘prefix-basic-css’, get_template_directory_uri(). ‘/css/basic-style.css’); // Register styles in WordPress wp_register_style(‘first-css’, get_template_directory_uri(). … Read more

Speeding Up Bulk Post Creation – wp_insert_post & update_post_meta

Siteground has WP-CLI installed and when you have WooCommerce installed it adds its own set of WP-CLI commands. See this: https://github.com/woocommerce/woocommerce/wiki/WC-CLI-Overview With this your solution would be cleaner as it would go though WC’s API. Maybe you can also check for ideas how WC does it. I remember in the add/edit product UI there was … Read more

Easy way to process search results before displaying

You can use pre_get_posts filter to filter out what you need. There’s an example on how to do this in Codex: https://codex.wordpress.org/Plugin_API/Action_Reference/pre_get_posts#Exclude_Pages_from_Search_Results function search_filter($query) { if ( !is_admin() && $query->is_main_query() ) { if ($query->is_search) { $query->set(‘post_type’, ‘post’); } } } add_action(‘pre_get_posts’,’search_filter’); Also, this article might get you in the direction of editing the search form…

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