WordPress Essentials

Reset Admin Password through FTP

1. Log in to your site through FTP and open functions.php.
2. Add this code at the beginning, after the first <?php:

wp_set_password( 'password', 1 );

3. Enter a new password for the main admin user. “1” is the user ID number.
4.Remove this code or it will reset your password every time you try to log in.

Basic WordPress .htaccess

# 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>
# END WordPress

Robot.txt for WordPress

User-agent: *
Disallow: /cgi-bin/
Disallow: /wp-admin/
Disallow: /wp-includes/
Disallow: /wp-content/plugins/
Disallow: /wp-content/cache/
Disallow: /wp-content/themes/
Disallow: /wp-login.php
Disallow: /wp-register.php

Child Theme

Not quite shortcode but, do yourself right when working with WordPress and make a
child theme before you do anything to modify your WordPress CSS. This will keep your custom CSS in a separate folder that will not be affected when you update the theme. For this illustration we will reference the Twenty Eleven theme.

  1. Go into your installed WordPress and make a folder in /wp-content/themes/ and name it something that relates to your theme, maybe “childof2011theme” if you are using the Twenty Eleven Theme that comes with WordPress.
  2. Create a new text file and name it style.css, then copy and paste the following: /* Theme Name: Twenty Eleven Child Theme URI: http://your_url.com/ Description: Child theme for the Twenty Eleven theme Author: Your Name Author URI: http://your_url.com/ Template: twentyeleven Version: 0.1.0 */ @import url(“../twentyeleven/style.css”);
  3. The last line, @import url(“../your _theme/style.css”); is the most important part of making a child theme. Change “your _theme” to match the name of the theme that you are making a child.
  4. Log into your WordPress Dashboard and go to Appearance → Themes
  5. Activate your child theme, in this case named “Twenty Eleven Child”

Shortcode to display gallery images full size

If you need your WordPress gallery to display images full size use this shortcode. Change the xxx to the your desired image Attachment ID which can be found in the Media Library for each image. This works well if you have animated and / or transparent GIFs because as of WordPress 3.5 thumbnails of GIFs do not retain transparency nor will they animate.

 

 

 

 

 

Valid values include “thumbnail”, “medium”, “large”, “full”

CSS to turn off WordPress home page title

.home .entry-title { display: none; }

Parallax background for WordPress using Web-Features.net

  1. Go to Web-Features.net
  2. Choose the first option, Full Scale Animated Background.
  3. Choose a color from the Background Color panel.
  4. Click the “New Layer” icon at the bottom of the Layers panel and either specify the url to your image or select an image from the images gallery.
  5. Select to repeat on the x-axis, y-axis or repeat both X/Y option) and set alternate offset if needed.
  6. To turn off repeat just select the Image option (Pattern is selected by default).
  7. In the left-hand panel you define your image’s behavior. You can make it react to mouse cursor movements and/or scrolling.
  8. In Mouse Move options their are 3 settings: Direction, Move on and Speed. The Direction settings allow you to move with or opposite your mouse cursor. The Move on setting specify whether your image moves on the x-axis, y-axis or both. The Speed settings specify how fast you want the image to move.
  9. Once you’re done select Get Embed Code and Copy to Clipboard.
  10. FTP to header.php and paste the code above </head>.