Performance and styles not working fine after changing permalink structure

Your .htaccess should not be modified on the WordPress part, so it should always be: # BEGIN WordPress <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteRule ^index\.php$ – [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] </IfModule> # END WordPress It looks like if you have your WordPress install in a Subdirectory of … Read more

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

What is a reasonable get_num_queries() result?

Depends on the use case. But 100 def. says there’s something gone wrong. If you got a lot of custom tables and a lot of different stuff from different tables that you need to display on one page/request, then I’d say 40 is higher than usual. My personal framework does around 10-15(?) queries for a … Read more

store/cache ajax sent data to avoid repeated request

Attempting to answer this question directly: if the data you are returning is exactly the same each time, you can send cache control / expires headers with your AJAX response so that the browser knows not to request again for a while. // ask the browser to cache this response, to reduce requests $expires = … Read more

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