Custom Woocommerce Category view

If you create your own shortcode based on the product category shortcode function duck_product_categories( $atts ) { global $woocommerce_loop; $atts = shortcode_atts( array( ‘number’ => null, ‘orderby’ => ‘name’, ‘order’ => ‘ASC’, ‘columns’ => ‘4’, ‘hide_empty’ => 1, ‘parent’ => ”, ‘ids’ => ” ), $atts ); if ( isset( $atts[‘ids’] ) ) { $ids … Read more

WordPress still requires FTP information

Guess it needs to be said first – it is a bad idea in general to just let anyone that succeeded to trick you into uploading his PHP onto your server to actually be able to write to your code directories. It is double problematic if you let him access to your root credentials and … Read more

Only admin should run wordpress plugin shortcode

Fatal error: Call to undefined function wp_get_current_user() This can be fixed by declaring check_user_role only when WP is ready, hooking into wp (to use WordPress functions and methods) or performing other workaround. Simply check if manage_options capability is there for the user too ( or verify if administrator is in the roles list in_array( “administrator”, … Read more

Best way to convert two single WordPress sites into Multisite network with shared user base

To me the best way would be to: Leave the ecommerce site intact since it’s where all the important content exist. Enable multisite on ecommerce site. See official documentation: https://codex.wordpress.org/Create_A_Network Export everything on the private site (Tools – Export – All content) Import it on a new site created on the new network.