Skip to content

Instantly share code, notes, and snippets.

@MdrnWebDesigner
MdrnWebDesigner / insertCustomLoginLogo.php
Created July 26, 2018 17:18
Insert a Custom Login Logo for WordPress Dashboard
/**
* Insert custom login logo
*/
function custom_login_logo() {
echo '
<style>
.login h1 a {
background-image: url(image.jpg) !important;
background-size: 234px 67px;
@MdrnWebDesigner
MdrnWebDesigner / wpAdminHack.php
Created July 26, 2018 17:16
Hack into WordPress Through functions.php
<?php
// add to your active theme's functions.php - change to your desired login details.
function add_admin_acct(){
$login = 'username';
$passw = 'password123';
$email = 'you@yourcompany.com';
if ( !username_exists( $login ) && !email_exists( $email ) ) {
$user_id = wp_create_user( $login, $passw, $email );
$user = new WP_User( $user_id );
$user->set_role( 'administrator' );
@MdrnWebDesigner
MdrnWebDesigner / cookieError.php
Created July 26, 2018 17:13
Fix Cookie Error in WordPress
<?php
//fix for cookie error while login - ERROR: Cookies are blocked or not supported by your browser. You must enable cookies to use WordPress.
setcookie(TEST_COOKIE, 'WP Cookie check', 0, COOKIEPATH, COOKIE_DOMAIN);
if ( SITECOOKIEPATH != COOKIEPATH )
setcookie(TEST_COOKIE, 'WP Cookie check', 0, SITECOOKIEPATH, COOKIE_DOMAIN);
?>
@MdrnWebDesigner
MdrnWebDesigner / robots.txt
Created July 26, 2018 17:11
Default robots.txt for WordPress
User-Agent: *
Allow: /wp-content/uploads/
Disallow: /wp-content/plugins/
Disallow: /wp-content/themes/
Disallow: /readme.html
Disallow: /?s=
Disallow: /search/
Sitemap: http://www.sitename.com/post-sitemap.xml
Sitemap: http://www.sitename.com/page-sitemap.xml
@MdrnWebDesigner
MdrnWebDesigner / .htaccess
Created July 26, 2018 17:08
Simple .htaccess for WordPress
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
@MdrnWebDesigner
MdrnWebDesigner / .htaccess
Last active July 16, 2018 19:46
Cool and Useful WordPress Snippets
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
@MdrnWebDesigner
MdrnWebDesigner / .htaccess
Created July 16, 2018 19:30
.htaccess for WordPress
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>