responsive.css in the WordPress should be prioritized

If you want to make sure the second stylesheet loads after the first, you can use the third argument of wp_enqueue_style to set a dependency, eg: wp_enqueue_style( ‘styles’, THEMEROOT . ‘/css/style.css’, array() ); wp_enqueue_style( ‘responsive’, THEMEROOT . ‘/css/responsive.css’, array(‘styles’) ); As for having all the styles in responsive.css override style.css, that is going to entirely … Read more

WordPress 4.8.1 php getting commented

As I mentioned in the comments, you should not and also can not use codes inside your content. Any code tags that you use will be escaped. Instead, define a shortcode in your theme’s functions.php file and use that inside your content. Let’s create a simple shortcode together: function create_shortcode( $atts ) { // Create … Read more

How to show a ‘correct’ message after submit a form?

I solved the problem. First I check if there are errors and then I add a custom redirect url like this: if ( count($error) == 0 ) { wp_redirect( get_permalink() . ‘?updated=true’ ); } And finally I added a message using ‘GET’ method: <?php if ( $_GET[‘updated’] == ‘true’ ) : ?> <p class=”form-submit-success” style=”color: … Read more

Custom Menus: dynamic highlighting problem with custom home link

I achieved this with some jQuery: $(“#sidebar ul li”).each(function () { if ($(this).find(“a”).attr(“href”) == window.location.href) { $(this).addClass(“current-menu-item”); } }); (My nav is in a div with the id ‘sidebar’, you will need to change the first selector). It checks if the href of the links is the same as the current URL, and if so, … Read more

Unique session WordPress

You can do this by changing LOGGED_IN_KEY constant in your wp-config.php before logging in. define(‘AUTH_KEY’, ‘put your unique phrase here’); Update: it’s better to invalidate all secret keys. They can be generated by WordPress own generator here: https://api.wordpress.org/secret-key/1.1/

Custom gallery in wp3.5

I guess you were sorta correct, @david.binda, lol! After a lot of reading, and experimenting, I added the code below to the else statement in my functions file, and it appears to be working as it did before, although the process seems a lot “bulkier” with the new gallery trying to do it’s thing. $post_content … Read more

Change “en-US” to “en”

If you want to get the language of the browser do so: $lang = substr($_SERVER[‘HTTP_ACCEPT_LANGUAGE’], 0, 2); If you want to redirect to ?lang=en: header(“location: {$_SERVER[‘REQUEST_URI’]}?lang={$lang}”); You should read about HTTP_ACCEPT_LANGAUGE. There are many ways you can dance with languages but you should understand some key points. Chose the default language of your website (French … Read more