Remember language choice on multisite website

setcookie() has the following signature: setcookie ( $name, $value = “”, $expires = 0, $path = “”, $domain = “”, $secure = FALSE, $httponly = FALSE ) You’re setting the cookie’s value to 1 in your code. I suspect you intend to do something more like setcookie(‘language’, $_GET[‘language’], time() + 1209600, “/”, “example.com”, false); Notes … Read more

Hide custom field value

If the registered users are all within the WP user table then you can do something like this <?php if( is_user_logged_in() ) { /// link to membership section } else { /// link to signup page? } ?> This will check the current status of the user and see if they are logged in or … Read more

remove_action from parent theme using child theme functions.php

Well, all I needed to fix the issue was to add the exact same priority to the remove_action and it worked pretty well, thanks to Sally CJ answer add_action( ‘wp_head’, ‘remove_site_hero_sections’); function remove_site_hero_sections() { global $theme_header_layout; remove_action(‘theme_site_header’, array($theme_header_layout, ‘site_hero_sections’), 9999); }

Child theme is not rendering parent and own javascripts (but css loaded properly, js not)

The function get_template_directory_uri always returns the directory of the PARENT THEME, even if in a child theme, while the function get_stylesheet_directory_uri() returns the directory of your child theme. I guess that your scripts are enqueued in the parent theme using the “get_stylesheet_directory_uri” method, meaning the javascript won’t be found in the child theme. I would … Read more