How can I add a title to this ‘maintenance mode’ function?

You can pass a title to the wp_die() function or even any other HTML content like heading tags: https://codex.wordpress.org/Function_Reference/wp_die But if you are trying to have more control over what’s being outputted, you should use the template_include filter and use your custom template: https://codex.wordpress.org/Plugin_API/Filter_Reference/template_include EXAMPLE: add_filter( ‘template_include’, ‘show_maintenance_page’, 99 ); function show_maintenance_page( $template ) { … Read more

I have a snippet to redirect all users to a maintenance page. How do I exclude users with admin role?

I would advise againt using anonymous functions for callback (when ever you can) as you can’t use a targeted remove_action on it. What Maythan8 answered will work but it can be done with fewer functions. add_action(‘template_redirect’, ‘bt_maintenance_redirect’); function bt_maintenance_redirect () { if (is_page(4848) || current_user_can(‘administrator’)) return; if (wp_safe_redirect(esc_url(home_url(‘maintenance/’)))) exit; } You used esc_url_raw but this … Read more

What are the best practices for maintaining and deploying several parent themes?

While I agree with Justin Tadlock on a lot of things, I strongly disagree with him on this. The reason parent/child themes exist is that there’s a lot of common functionality used across websites. Instead of re-inventing the wheel every time, it’s better to build from a solid base that has been tested by hundreds … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)