How to see your website on hostgator before DNS is setup

January 5, 2012 – 8:35 pm by

Finding your FTP server:

  • In your bluehost cpanel, go to the left sidebar – click “expand stats” if that link is present.
  • You are looking for an entry called “xxx IP Address” either one will work here
    • “xxx” might be “Shared” or “Dedicated” depending on your serve

For grins, lets say your shared IP address is 123.123.123.123

To create your temporary URL, you will add the IP address plus your cpanel username like so:

http://ipaddress/~username

in our example it would be like this:

http://123.123.123.123/~wprelief/

Once you create your URL, put it into your browser and view your site!
Remember, for WordPress to work correctly you will need to set the Server URL to this temporary URL. Then, when you are ready to switch the DNS over, log in to WordPress through your Temporary URL, change the server URL to your actual domain. Then switch the DNS and wait for the site to come up!

How to FTP into your hostgator account before DNS is setup

January 5, 2012 – 8:33 pm by

Finding your FTP server:

  • In your hostgator cpanel, go to the left sidebar – click “expand stats” if that link is present.
  • You are looking for an entry called “xxx IP Address” either one will work here
    • “xxx” might be “Shared” or “Dedicated” depending on your server

Connecting with FTP:

  • In your FTP program, enter in the information from the previous step for your hostname
  • Enter in your cpanel username as the ftp user
  • Enter in your cpanel password as the ftp password

You should be able to connect up now!

 

 

My WP-Admin is blank! What do I do!?

January 4, 2012 – 12:51 pm by

We had this happen on a customer’s site today. It is actually not a huge deal as it seems to be caused by a cookie problem.

To be able to log in to your wp-admin, simply add /wp-login.php?logout=true to your domain name and hit enter. This will cause WordPress to log you out and it will show you the admin login page!

Now, if you continue to have issues, try replacing all the wp-admin and wp-includes files on your server over FTP. Then try the logout URL again.

Other issues? Please tell us in the comments, we would be glad to help!

Add a CDN subdomain on GoDaddy for your WordPress site

December 21, 2011 – 4:50 pm by

When optimizing your wordpress, it is a great idea to use a CDN. This can be done in many ways but the easiest is to create a subdomain that points to the same directory as your main site.

The reason CDNs works so well is that it allows your browser to download from multiple places at once, working around the per-domain connection problem.

On GoDaddy, you can do this pretty easily although it is not obvious.

To add a subdomain, check out the Managing Your Hosting Account Subdomains article.  On this page it tells you to do the following:

  1. Log in to your Account Manager.
  2. From the My Products section, click Web Hosting.
  3. Next to the hosting account you want to use, click Launch.
  4. In the Settings section of the Hosting Control Center, click the Domain Management icon.
  5. From the All Domains panel, click the domain to which the subdomain(s) will be added.
  6. Click Add Subdomain.
  7. Enter a single subdomain or multiple subdomains separated by a comma.
  8. Select whether the subdomain content will reside in a folder of the same name or a new or existing folder.  Select the “Create or select folder” option and make sure that the folder you choose is the same as the root of your website.
  9. Click Ok.

The only modification to the GoDaddy docs that we have is in step 8. See the text next to the crossed out text.

Once you have this completed, all you have to do is modify your CDN settings in whatever plugin you are using to pull images, JS, and CSS from the CDN and then you are done!

Side Note: We like WP Super Cache for CDN, as it also comes with that awesome caching system for your site.

How to see your website on bluehost before DNS is setup

December 20, 2011 – 11:55 am by

This was not perfectly clear out of the gate with bluehost, so we’re writing it up here for the next time we need it.

The term you are looking for in the blue host help docs is “Temporary URL” – if you want to search for it. The information is below though.

Find your server IP address:

  • In your bluehost cpanel, go to the left sidebar – click “expand stats” if that link is present.
  • You are looking for an entry called “Shared IP Address”

For grins, lets say your shared IP address is 123.123.123.123

To create your temporary URL, you will add the IP address plus your cpanel username like so:

http://ipaddress/~username

in our example it would be like this:

http://123.123.123.123/~wprelief/

Once you create your URL, put it into your browser and view your site!

Remember, for WordPress to work correctly you will need to set the Server URL to this temporary URL. Then, when you are ready to switch the DNS over, log in to WordPress through your Temporary URL, change the server URL to your actual domain. Then switch the DNS and wait for the site to come up!

 

How to FTP into your bluehost account before DNS is setup

December 20, 2011 – 11:49 am by

This is not obvious unless you dig into the help docs, stumble on it, or ask for help (like I did).

Finding your FTP server:

  • In your bluehost cpanel, go to the left sidebar – click “expand stats” if that link is present.
  • You are looking for an entry called “Hostname” or “Shared IP Address” either one will work here

Connecting with FTP:

  • In your FTP program, enter in the information from the previous step for your hostname
  • Enter in your cpanel username as the ftp user
  • Enter in your cpanel password as the ftp password

You should be able to connect up now!

 

 

Contact Form 7 and Nivo Slider don’t work well together!

December 12, 2011 – 1:50 pm by

If you are using Contact Form 7 and Nivo Slider then you might need to add the following code to your functions.php file, so that your slideshows work.

add_action( 'wp_print_scripts', 'my_deregister_javascript', 100 );
function my_deregister_javascript() {
wp_deregister_script( 'contact-form-7' );
}

This will remove the contact form 7 version of the jQuery easing script, which removes the conflict.  If you run into any trouble with this, tell us!

User Roles in the WordPress Database

December 1, 2011 – 10:15 am by

Where are the user roles stored for WordPress?

If you have ever been looking for where the actual user roles are stored for WordPress, say because all of a sudden you have no user roles anymore, they are actually socked away in the database.  Go to your wp_options table and find the row with option_name = ‘wp_user_roles’. This is where you will find the information, in a serialized array.

Caveat: if your prefix is something other than “wp_”, like say “wp_purple_elephant_” you will need to search your wp_purple_elephant_options table, and then find the row called wp_purple_elephant_user_roles in the table.

What are the default user role values in the WordPress database?

The default user_levels or user roles data that is installed with WordPress 3.2.1 are:

a:7:{s:13:"administrator";a:2:{s:4:"name";s:13:"Administrator";s:12:"capabilities";a:63:{s:13:"switch_themes";b:1;s:11:"edit_themes";b:1;s:16:"activate_plugins";b:1;s:12:"edit_plugins";b:1;s:10:"edit_users";b:1;s:10:"edit_files";b:1;s:14:"manage_options";b:1;s:17:"moderate_comments";b:1;s:17:"manage_categories";b:1;s:12:"manage_links";b:1;s:12:"upload_files";b:1;s:6:"import";b:1;s:15:"unfiltered_html";b:1;s:10:"edit_posts";b:1;s:17:"edit_others_posts";b:1;s:20:"edit_published_posts";b:1;s:13:"publish_posts";b:1;s:10:"edit_pages";b:1;s:4:"read";b:1;s:8:"level_10";b:1;s:7:"level_9";b:1;s:7:"level_8";b:1;s:7:"level_7";b:1;s:7:"level_6";b:1;s:7:"level_5";b:1;s:7:"level_4";b:1;s:7:"level_3";b:1;s:7:"level_2";b:1;s:7:"level_1";b:1;s:7:"level_0";b:1;s:17:"edit_others_pages";b:1;s:20:"edit_published_pages";b:1;s:13:"publish_pages";b:1;s:12:"delete_pages";b:1;s:19:"delete_others_pages";b:1;s:22:"delete_published_pages";b:1;s:12:"delete_posts";b:1;s:19:"delete_others_posts";b:1;s:22:"delete_published_posts";b:1;s:20:"delete_private_posts";b:1;s:18:"edit_private_posts";b:1;s:18:"read_private_posts";b:1;s:20:"delete_private_pages";b:1;s:18:"edit_private_pages";b:1;s:18:"read_private_pages";b:1;s:12:"delete_users";b:1;s:12:"create_users";b:1;s:17:"unfiltered_upload";b:1;s:14:"edit_dashboard";b:1;s:14:"update_plugins";b:1;s:14:"delete_plugins";b:1;s:15:"install_plugins";b:1;s:13:"update_themes";b:1;s:14:"install_themes";b:1;s:11:"update_core";b:1;s:10:"list_users";b:1;s:12:"remove_users";b:1;s:9:"add_users";b:1;s:13:"promote_users";b:1;s:18:"edit_theme_options";b:1;s:13:"delete_themes";b:1;s:6:"export";b:1;s:15:"b5280Rd_manager";b:1;}}s:6:"editor";a:2:{s:4:"name";s:6:"Editor";s:12:"capabilities";a:34:{s:17:"moderate_comments";b:1;s:17:"manage_categories";b:1;s:12:"manage_links";b:1;s:12:"upload_files";b:1;s:15:"unfiltered_html";b:1;s:10:"edit_posts";b:1;s:17:"edit_others_posts";b:1;s:20:"edit_published_posts";b:1;s:13:"publish_posts";b:1;s:10:"edit_pages";b:1;s:4:"read";b:1;s:7:"level_7";b:1;s:7:"level_6";b:1;s:7:"level_5";b:1;s:7:"level_4";b:1;s:7:"level_3";b:1;s:7:"level_2";b:1;s:7:"level_1";b:1;s:7:"level_0";b:1;s:17:"edit_others_pages";b:1;s:20:"edit_published_pages";b:1;s:13:"publish_pages";b:1;s:12:"delete_pages";b:1;s:19:"delete_others_pages";b:1;s:22:"delete_published_pages";b:1;s:12:"delete_posts";b:1;s:19:"delete_others_posts";b:1;s:22:"delete_published_posts";b:1;s:20:"delete_private_posts";b:1;s:18:"edit_private_posts";b:1;s:18:"read_private_posts";b:1;s:20:"delete_private_pages";b:1;s:18:"edit_private_pages";b:1;s:18:"read_private_pages";b:1;}}s:6:"author";a:2:{s:4:"name";s:6:"Author";s:12:"capabilities";a:10:{s:12:"upload_files";b:1;s:10:"edit_posts";b:1;s:20:"edit_published_posts";b:1;s:13:"publish_posts";b:1;s:4:"read";b:1;s:7:"level_2";b:1;s:7:"level_1";b:1;s:7:"level_0";b:1;s:12:"delete_posts";b:1;s:22:"delete_published_posts";b:1;}}s:11:"contributor";a:2:{s:4:"name";s:11:"Contributor";s:12:"capabilities";a:5:{s:10:"edit_posts";b:1;s:4:"read";b:1;s:7:"level_1";b:1;s:7:"level_0";b:1;s:12:"delete_posts";b:1;}}s:10:"subscriber";a:2:{s:4:"name";s:10:"Subscriber";s:12:"capabilities";a:2:{s:4:"read";b:1;s:7:"level_0";b:1;}}s:10:"editorPlus";a:2:{s:4:"name";s:7:"Editor+";s:12:"capabilities";a:38:{s:17:"moderate_comments";b:1;s:17:"manage_categories";b:1;s:12:"manage_links";b:1;s:12:"upload_files";b:1;s:15:"unfiltered_html";b:1;s:10:"edit_posts";b:1;s:17:"edit_others_posts";b:1;s:20:"edit_published_posts";b:1;s:13:"publish_posts";b:1;s:10:"edit_pages";b:1;s:4:"read";b:1;s:7:"level_7";b:1;s:7:"level_6";b:1;s:7:"level_5";b:1;s:7:"level_4";b:1;s:7:"level_3";b:1;s:7:"level_2";b:1;s:7:"level_1";b:1;s:7:"level_0";b:1;s:17:"edit_others_pages";b:1;s:20:"edit_published_pages";b:1;s:13:"publish_pages";b:1;s:12:"delete_pages";b:1;s:19:"delete_others_pages";b:1;s:22:"delete_published_pages";b:1;s:12:"delete_posts";b:1;s:19:"delete_others_posts";b:1;s:22:"delete_published_posts";b:1;s:20:"delete_private_posts";b:1;s:18:"edit_private_posts";b:1;s:18:"read_private_posts";b:1;s:20:"delete_private_pages";b:1;s:18:"edit_private_pages";b:1;s:18:"read_private_pages";b:1;s:10:"list_users";b:1;s:10:"edit_users";b:1;s:12:"create_users";b:1;s:12:"delete_users";b:1;}}s:8:"PEIadmin";a:2:{s:4:"name";s:9:"PEI Admin";s:12:"capabilities";a:38:{s:17:"moderate_comments";b:1;s:17:"manage_categories";b:1;s:12:"manage_links";b:1;s:12:"upload_files";b:1;s:15:"unfiltered_html";b:1;s:10:"edit_posts";b:1;s:17:"edit_others_posts";b:1;s:20:"edit_published_posts";b:1;s:13:"publish_posts";b:1;s:10:"edit_pages";b:1;s:4:"read";b:1;s:7:"level_7";b:1;s:7:"level_6";b:1;s:7:"level_5";b:1;s:7:"level_4";b:1;s:7:"level_3";b:1;s:7:"level_2";b:1;s:7:"level_1";b:1;s:7:"level_0";b:1;s:17:"edit_others_pages";b:1;s:20:"edit_published_pages";b:1;s:13:"publish_pages";b:1;s:12:"delete_pages";b:1;s:19:"delete_others_pages";b:1;s:22:"delete_published_pages";b:1;s:12:"delete_posts";b:1;s:19:"delete_others_posts";b:1;s:22:"delete_published_posts";b:1;s:20:"delete_private_posts";b:1;s:18:"edit_private_posts";b:1;s:18:"read_private_posts";b:1;s:20:"delete_private_pages";b:1;s:18:"edit_private_pages";b:1;s:18:"read_private_pages";b:1;s:10:"list_users";b:1;s:10:"edit_users";b:1;s:12:"create_users";b:1;s:12:"delete_users";b:1;}}}

This is a horrible mess, but it is not meant to be 100% human-readable. Your WordPress blog stores the information like this, so that it can access it with one simple query to the database and then unserialize it into an array. This is MUCH faster than having this data stored in it’s own table and then having the whole table queried and pushed into an array each time WordPress needs this data.

You can download a file with this data here.

All my WordPress user roles are gone, how do I fix it!?

The steps I would take are these:

  1. Open your database
  2. Backup your wp_options table (prefixes will change the beginning of the table name of course)
  3. Find the row from the first section of this article “wp_user_roles” in the wp_options table
  4. Copy the default user roles data from the section just before this one  (make sure you don’t copy anything extra). You can always get the data here and it will be clean of blog-article crap.
  5. Perform an update on the wp_user_roles row in your wp_options table, to have this data.
  6. Go to one of your user’s edit page in WordPress (or /wp-admin/profile.php for your profile) and verify that your roles are back!

If you have any other questions or comments, please shoot over a comment on this post.

How to trigger the WP post page to save a post automagically

November 9, 2011 – 8:22 pm by

UPDATE: If you’re running WordPress 3.6  you don’t need to even worry about this. All posts will be automagically saved while editing. Pretty slick!

There may be a time as a plugin developer when you wrote a plugin that effects the post-editing or page-editing interface for WordPress. In this case, you may also need to somehow trigger the content to auto save, like WordPress will do automatically from time to time.

The best and easiest way to do this without a page reload, is to call the “autosave()” function in JavaScript.

For example, let’s say you somehow added a custom field to the page that is controlled by a new input field instead of with the custom fields form.

You could have the code look something like this when it is rendered:

Then, in your additional JavaScript you could do this:

jQuery('#my_custom_field').change(function(){

autosave(); //saves the whole post interface

});

Of course, I am cutting A LOT of corners here. The point is not to show you have to add a custom field input to your post page, but more so to show you how to trigger a save on your posts or page edit pages.  Good Luck!

How to add content based on a custom field to your posts

October 26, 2011 – 9:26 pm by

In your theme files, you may want to add some functionality that shows after your post content if and only if you have a specific custom field set.

This is actually pretty easy to do, just add this code to your functions.php file and make sure to change the name of your custom field key!

function sk_single_post_custom_field() {
   //The key of your custom field
   $customFieldKey = 'THE CUSTOM FIELD KEY NAME GOES HERE';

   global $post;

   //only show this if we are on the post page
   if (is_single()) {
     //gets the custom field from the post object
     $customFieldData = get_post_meta($post->ID, $customFieldKey, true);
     if (!is_null($customFieldData) && str_len($customFieldData) > 0) {
       //output your custom field data here -- you can wrap this output in whatever HTML you would like.
       echo $customFieldData;
     }
   }
}

For non Thesis (i.e. regular or custom build) themes:

//if you are using a custom built, or non thesis theme use this functionality
add_filter('the_content', 'sk_single_post_custom_field');

For thesis based themes:

//if you are using Thesis - use this to add it into the theme
add_action('thesis_hook_after_post', 'single_post_custom_field');

Make referral URLs like a Boss

September 14, 2011 – 9:33 am by

So many great podcasts have referral or affiliate URLs that absolutely rock, something like myblog.com/affiliateName.

I was curious how they were doing this, because most of my favorite podcasts are about streamlining and the hosts aren’t that technical! I realized instantly that they were not doing this with .htaccess, which would totally work. The problem is that it is hard to manage and the easiest way short of deleting your database to screw up your site.

In my quest, I found the Redirection plugin.  It very quickly and easily allows you to put in 301 redirects, custom redirects, and redirects based on GET parameters, which .htacces can’t do!  Basically, it inserts itself into the beginning of the mechanism in WordPress that handles what files WordPress calls when a request is made to the software and looks for your custom redirects first.

Your redirects can be as simple as a basic old page -> new page, or a non-existant path on your server to one that exists somewhere else.

For my example, I am going to set up a quick redirect to http://wordpress.org/extend/plugins/redirection/ from http://wp-relief.com/redirection

It is as simple as copy paste:

Redirection %E2%80%B9 WordPress Relief %E2%80%94 WordPress 300x73 Make referral URLs like a Boss

Then, once you add the redirection in, you get a nice little green bar to show you the redirect is setup and how many times people have used it:

Redirection %E2%80%B9 WordPress Relief %E2%80%94 WordPress 1 300x15 Make referral URLs like a Boss

The same functionality holds true for referral URLs as does for my redirection in the example. Just enter the name you want to give people and then the URL, save it and you are done!

Disable your Website to Visitors but not Users – Part II

April 7, 2011 – 8:25 am by

Previously, we talked about how to disable your website to visitors but not logged in users through your theme.

We have been using a plugin in our projects for some time to do this a little bit easier. The plugin is called WP Require Auth plugin.  It very simply makes it so that all requests to see pages on your site are redirected to the login screen.

It is easy, simple, and effortless. Just install the plugin and go!

This is great for use on a dev site or a site that is in stealth mode.

pixel Disable your Website to Visitors but not Users   Part II