woocommerce get_woocommerce_currency_symbol()

Your code should work, which means the issue might be in the database. You can check these 2 functions:get_woocommerce_currency() and get_woocommerce_currency_symbol() from the WooCommerce docs that shows that you are using the functions correct. What is left is for you to start some troubleshooting steps to see what causes the error: What is get_option(‘woocommerce_currency’) returning? … Read more

Safely disable WP REST API

From the author original question I’ve chosen option 2 that came from wordpress official recommendations(https://developer.wordpress.org/rest-api/using-the-rest-api/frequently-asked-questions/#can-i-disable-the-rest-api). So just put in your functions.php to let only logged in users use the rest api (but just cross check original link in case my code block is outdated 😉 ): UPD(01-10-2021): add_filter( ‘rest_authentication_errors’, function( $result ) { // If … Read more

How do I create different editable sections within a WordPress page?

Unfortunately adding multiple editable fields in a single page is not particularly easy using WordPress by itself. Many WP devs I know (myself included) rely on the Advanced Custom Fields Plugin for additional content fields. The steps to make this happen: 1) Install the ACF the plug. 2) In the settings area for ACF create … Read more

How to add “active” class to wp_nav_menu() current menu item (simple way)

Just paste this code into functions.php file: add_filter(‘nav_menu_css_class’ , ‘special_nav_class’ , 10 , 2); function special_nav_class ($classes, $item) { if (in_array(‘current-menu-item’, $classes) ){ $classes[] = ‘active ‘; } return $classes; } More on wordpress.org: Highlight Current Page in WordPress 3.0 Menus Adding .active class to active menu item