Shared publicly  - 
 
The beauty of WordPress® is its flexibility. There are many simple ways to tweak your WordPress site to enhance your visitor’s experience. Here are just a few of Go Daddy Technologist +Gabe Williams' favorites:

Automatically Update Your Copyright Notice -

Add this code to your footer to automatically update the copyright each year.

/CODE/
Copyright &copy; <?php echo the_date('Y'); ?> Website Name

Redirect back To Referring Page After Login -

This simple snippet added to your functions.php file will redirect members back to the page they logged in from.

/CODE/
if ( (isset($_GET['action']) && $_GET['action'] != 'logout') || (isset($_POST['login_location']) && !empty($_POST['login_location'])) ) {
add_filter('login_redirect', 'my_login_redirect', 10, 3);
function my_login_redirect() {
$location = $_SERVER['HTTP_REFERER'];
wp_safe_redirect($location);
exit();
}
}

Change Admin logo -

To change the admin logo that is shown on the top left side of the page, add this to your functions.php template. This gives you an easy way to brand your WordPress site for registered users.

/CODE/
function custom_admin_logo() {
echo '<style type="text/css">
#header-logo { background-image: url('.get_bloginfo('template_directory').'/images/admin_logo.png) !important; }
</style>';
}
add_action('admin_head', 'custom_admin_logo');




SECURITY

Move Your wp-content Folder -

Almost all WordPress sites are set up the same. A great way to discourage hackers is to move your wp-content directory to a new location. Just specify where you moved your folder in your wp-config.php file.

/CODE/
// full local path of current directory (no trailing slash)
define('WP_CONTENT_DIR', $_SERVER['DOCUMENT_ROOT'].'/another-folder-or-location/wp-content');

// full URI of current directory (no trailing slash)
define('WP_CONTENT_URL', 'http://your-domain-name.com/another-folder-or-location/wp-content');

// full local path of current directory (no trailing slash)
define('WP_PLUGIN_DIR', $_SERVER['DOCUMENT_ROOT'].'/another-folder-or-location/wp-content/plugins');

// full URI of current directory (no trailing slash)
define('WP_PLUGIN_URL', 'http://your-domain-name.com/another-folder-or-location/wp-content/plugins');

Disable Directory Browsing -

Unless you specifically need it, always disable directory browsing on your site. Add this to your .htaccess and you will be set.

/CODE/
# disable directory browsing
Options All –Indexes

Use .htaccess To Blacklist Users And Bots -

If you are using any analytics program, you should be able to see if you are getting spammed by certain IPs. You can easily block them by adding this to your .htaccess.

/CODE/
<Limit GET POST PUT>
order allow, deny
allow from all
deny from 123.124.125.3
deny from 124.125.126.4
deny from 125.126.127.5
</Limit>


CSS

Center Your WordPress Website -

This little trick is extremely useful since you never know what resolution your viewer’s devices will be set at.

/CODE/
#wrapper{
width:960px;
margin:0 auto;
text-align:left;
}

CS Sticky Footer -

This is a super common request. Because often times your WordPress site and content is dynamic, you never know just how long the page will be. This code helps ensure your footer will display at the bottom of the page, just add to your stylesheet.

/CODE/
* {margin:0;padding:0;}

/* must declare 0 margins on everything, also for main layout components use padding, not
vertical margins (top and bottom) to add spacing, else those margins get added to total height
and your footer gets pushed down a bit more, creating vertical scroll bars in the browser */

html, body {height: 100%;}

#wrap {min-height: 100%;}

#main {overflow:auto;
padding-bottom: 150px;} /* must be same height as the footer */

#footer {position: relative;
margin-top: -150px; /* negative value of footer height */
height: 150px;
clear:both;}

/*Opera Fix*/
body:before {
content:"";
height:100%;
float:left;
width:0;
margin-top:-32767px;
}

This needs to be added to the head section of your page so that it displays correctly on Internet Explorer.

/CODE/
<!--[if !IE 7]>
<style type="text/css">
#wrap {display:table;height:100%}
</style>
<![endif]-->

*/

Add to HTML.

/CODE/
<div id="wrap">

<div id="main">

</div>

</div>

<div id="footer">

</div>

^+James Roberts
5
1
Dan Shaurette's profile photoGoDaddy's profile photo
9 comments
 
Cool tips. I'm using WordPress with a multi-site setup on GoDaddy right now. I'm thinking about also installing Drupal. Do you have any tips on which should be installed where for this to work best?
GoDaddy
 
As far as which directories to install to? That wont really affect performance, mostly just personal preference on how you want your site files to be organized. ^Colby
 
I ask because WordPress is at the root of the account, and if I make a drupal folder under that to hold those files, I don't think that would be sufficient because WP will redirect pages. There's probably some magic one needs to do in the .htaccess file to assist that, I just don't know what.
 
Clearly I was wrong, though. It didn't work before but does seem fine now. How very odd, yet fascinating. OK, so then, if I may continue, would I be able to direct a domain to mydomain.com/drupal but make it be mynewdomain.com, without a simple redirect? Something like an add-on subdomain perhaps?
GoDaddy
 
Quickest way I can think of doing that is setting up the sub domain in your hosting settings. We have a guide for that at http://x.co/kB1b. ^James
 
The subdomain isn't the issue; I've done that. It's having mynewdomain.com point to drupal.myolddomain.com or myolddomain.com/drupal. Either one, but not with just a domain redirect because either you have masking so the domain is always mynewdomain.com or it just gives the subdomain.

With cPanel you can have an AddOn domain which is a domain setup elsewhere that points to a subdomain on your host. All I can seem to get the domains to do is have mynewdomain.com use the same nameserver and IP address in the A Host records as myolddomain.com so that they are essentially equivalent.

With WordPress' Domain Mapping plugin this is taken care of when I want a new domain to point to a new WP site like newsite.myolddomain.com -- but the wrinkle here is that I want essentially the same thing except that subdomain isn't a new WP site, it's Drupal (or any other non-WP site for that matter).

So I know this is possible -- I'm just missing something to map the domain.
 
Thank you all for your time though, I do appreciate it!
GoDaddy
 
We have a domain manager on our hosting accounts that have similar functions to the cPanel feature you are describing. Instructions for it can be found at http://x.co/kB4e. Deluxe hosting or higher is required. ^James
 
*blink* It's that easy? Guys, thank you so much!
Add a comment...