how to add custom css at top above all css file for specific url

/** * Enqueue stylesheet before others */ class EnqueueStylesheetEarly { function __construct() { add_action( ‘wp_enqueue_scripts’, [ $this, ‘load_before_other_stylesheets’ ], 5 ); } /** * Register and enqueue stylesheet */ function load_before_other_stylesheets() { wp_register_style( ‘bootstrap-css’, plugin_dir_url( __FILE__ ) . ‘bootstrap.min.css’, [], ‘3.3.7’ ); wp_enqueue_style( ‘bootstrap-css’ ); } } Then you can load this with your other … Read more

What is the best practice workflow for new website overhaul and keeping current SEO ranking? [closed]

If you are only changing the theme or plugins, then it shouldn’t make a difference at all. I see no reason to create new posts and/or pages just because you are changing themes. If you are doing a complete site overhaul, however (you don’t specify), then yes, you should add 301 redirects to your .htaccess … Read more

Target second from last post in loop

You can achieve this by modifying your above shared code as following. $prelimartPosts = new WP_Query($args2); while ($prelimartPosts->have_posts() ) : $prelimartPosts->the_post(); if (($prelimartPosts->current_post +2) >= ($prelimartPosts->post_count)) { // This is last post and second last post get_template_part( ‘template-parts/content’, ‘front-center’ ); } else { // These are all other posts except last and second last posts … Read more

How to customize the colors within a stylesheet using a WordPress setting

I would recommend a color option. Generally, a color option just loads a separate style sheet. E.g., loading the style-blue.css style sheet would include all those elements you wanted to be blue. (You would load this in addition to your main style sheet.) This is how many themes work, so this a proven approach. This … Read more

How to get php file based on URL in WordPress

WP determines template file by following Template Hierarchy. The process has quite a few steps between URL and resulting PHP file loaded, so generally one is not a reliable indication of the other. Outside of looking through likely template files (good enough in a simple theme) you can try dumping this with code in template_include … Read more