Remove extract from function

It’s very simple: Just assign the value of shortcode_atts() (which is an array) to a variable and use it to access the shortcode attributes in the same way you access the items in any other arrays: $atts = shortcode_atts( array( ‘no’ => 1, ), $atts ); // Use $atts[‘no’] to get the value of the … Read more

Blog page error ‘Index of /blog’

There shouldn’t be a blog folder in the file manager. If there is one, your web server will load that instead of asking WordPress for the blog page. Delete the empty folder and it will work. You should never need to create folders or pages in the file manager or via FTP when using WordPress.

How to properly rewrite pagination rules for a CPT to avoid 404 error on /page/2

You don’t need the rewrite rules, and that’s not how they’d work anyway. The fundamental problem is that you decided not to modify the main query, but to replace it. There’s no need for the custom WP_Query or custom pagination, or a page template. Not to mention by running the main query then discarding the … Read more

Should I use docker in wordpress production?

My question is, is it a good idea to use docker for a big woocommerce website (more than 100k products)? Or will this incur a noticable performance cost compared to running wordpress straight on the VPS (without containerization)? It won’t make much difference, nothing you will notice. It’s not even in the top 50 things … Read more

How to allow WordPress updates to only one specific administrator?

SOLUTION: We take this code and paste it to functions.php : function createit_hide_upd_for_other_adm_users() { $current_user = wp_get_current_user(); if ( 777 != $current_user->ID ) { //change the user ID add_filter( ‘pre_site_transient_update_core’, ‘disable_updates’ ); add_filter( ‘pre_site_transient_update_plugins’, ‘disable_updates’ ); add_filter( ‘pre_site_transient_update_themes’, ‘disable_updates’ ); } else { } } add_action( ‘init’, ‘createit_hide_upd_for_other_adm_users’ ); You just need to find the … Read more

Live to Local on MAMP, not working, outputting functions.php code

If it’s outputting some PHP from functions.php but not the whole file then likely you’ve just got mismatched PHP opening/closing tags – <?php and ?> somewhere, or potentially even mismatched string quotations. You need to edit that file in a text editor and look carefully around the point it’s starting to output PHP for mismatched … Read more