WordPress tips that won't quit
Maintenance Mode
function wpr_maintenance_mode() {
if ( !current_user_can( 'edit_themes' ) || !is_user_logged_in() ) {
wp_die('Maintenance, please come back soon.');
}
}
add_action('get_header', 'wpr_maintenance_mode');
Query a single page
have_posts()) : $my_query->the_post();
$do_not_duplicate = $post->ID; ?>
Maintenance Mode
function wpr_maintenance_mode() {
if ( !current_user_can( 'edit_themes' ) || !is_user_logged_in() ) {
wp_die('<h2>Maintenance </h2><p>Doing a small upgrade, please come back in about an hour!');
}
}
add_action('get_header', 'wpr_maintenance_mode');
Remove wp-config.php after creating .gitignore
git rm --cached wp-config.php