Search 1Password with Google Chrome’s 1Password Extension

1Password is one of the Apps on my Mac that I use the most. 1Password can create strong, unique passwords for you, remember them, and restore them, all directly in your web browser. It come bundled with extensions for all the major browsers. Recently I have started using Google Chrome for Mac more and more. I happened to discover a new feature that I had no idea existed and decided to do a quick post to share it.

If you want to find a website login in 1Password you have to unlock it an then start searching for where you want to go.

Some browsers like Safari have a keyboard shortcut ( option + command + \ ) to bring up the quick search called Go & Fill Login. Safari’s version looks like this:

Until just recently I had no idea you could do something like this in Chrome, with Chrome it is actually even easier. All you have to do is start to type 1password in the browser bar area. This will start the quick search for 1password right from their. You will have to unlock 1password before you can use this feature. It looks like this and is just awesome.

If you don’t already use 1Password I highly recommend it. 1Password has certainly made my life easier, you can even sync it between multiple computers using DropBox.

Get 1Password
How to install 1Password browser extensions: http://blog.agile.ws/1518190697/
Get DropBox

Enable Multi-Site in WordPress

WordPress merging with WordPress MU makes an awesome software package even better. The issue now is, how do you turn on the multi-site functionality? If you are like me and find yourself forgetting that one line of code needed to kick off the setup of multi-site within WordPress. Then you made it to the right place, because for your benefit and mine I have taken the time to write down the steps involved. The first step is to install WordPress so be sure to head over to WordPress.org for the latest version and then do a standard install of WordPress. Once you have WordPress up and running you can enable multi-site in just a few quick steps.

1. Add the following to the wp-config.php

/**   MULTI-SITE SETUP   */
define('WP_ALLOW_MULTISITE', true);

2. Navigate to Tools > Network and choose your install type

You will have to choose what kind of network you want to run. Your choices are either Sub-directory setup or a Sub-domain setup. These choices affect how the addresses of your sites look.

Sub-directory
This configuration means that all your blogs/sites created within WordPress are extensions of your domain. So if you were using the domain myawesomesite.com then your blogs/sites within WordPress would all have domains like:
myawesomesite.com/siteone
myawesomesite.com/sitetwo

Sub-domain
This configuration does require some extra DNS work meaning you will need to setup a wildcard DNS record. With this setup each new blog/site in WordPress becomes it’s own sub-domain of the top level domain that was used to install WordPress. So if you installed WordPress on the url myawesomesite.com each new site’s domain would look like:
siteone.myawesomesite.com
sitetwo.myawesomesite.com

Once you have chosen the setup you want to run enter your network details and hit install.

3. Finish up the network install

There are a few things that you need to do manually to finish the install.

Create the blogs.dir directory
Create a new directory in the wp-content folder called blogs.dir, this directory will be where all your sites uploaded content is stored.

Edit wp-config.php
WordPress will generate some new settings for you to add to your config file. These settings are specific to your network. For the myawesomesite.com setup they would like this:

define( 'MULTISITE', true );
define( 'SUBDOMAIN_INSTALL', false );
$base = '/';
define( 'DOMAIN_CURRENT_SITE', 'myawesomesite.com' );
define( 'PATH_CURRENT_SITE', '/' );
define( 'SITE_ID_CURRENT_SITE', 1 );
define( 'BLOG_ID_CURRENT_SITE', 1 );

Edit or create the .htaccess file
If you already have a .htaccess file setup then you will just want to edit the area the contains WordPress rules. If you don’t have a .htaccess file go ahead and create one. Now all you have to do is copy in the settings provided by WordPress, save the file and you are done. This is an example of the code generated by WordPress:

RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]

# uploaded files
RewriteRule ^([_0-9a-zA-Z-]+/)?files/(.+) wp-includes/ms-files.php?file=$2 [L]

# add a trailing slash to /wp-admin
RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L]

RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]
RewriteRule  ^([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*) $2 [L]
RewriteRule  ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L]
RewriteRule . index.php [L]

4. Remove the Tools > Network menu option

Once you have your network setup you can remove the menu option simple by commenting out the enable multi-site option in your wp-config.php file.

/**   MULTI-SITE SETUP   */
//define('WP_ALLOW_MULTISITE', true);

Organize your dock by adding spacers in Snow Leopard

There is nothing like a shiny new mac and if you are like me, then you start with a fresh install rather then cloning your old machine. Since the dock on the new machine was not setup the way I like it a had to make a few changes and one of them is to add separators between applications. I do this to group like applications together. So to get started the first thing you will need to do is open Terminal on your Mac.

This is what my dock currently looks like.

Terminal can be found in: Applications > Utilities

To add a separator to the left side of the dock

defaults write com.apple.dock persistent-apps -array-add '{tile-data={}; tile-type="spacer-tile";}'

To add a separator to the right side of the dock

defaults write com.apple.dock persistent-others -array-add '{tile-data={}; tile-type="spacer-tile";}'

Each time you run one of the commands above it will create a new separator but you need to restart the dock to see them. To do this just type this into Terminal:

killall Dock

Displaying custom post types on your WordPress blog homepage

So you have created a great new custom post type in WordPress 3.0 but it doesn’t show on your homepage. To add your new post type to the homepage you could use the following code in your functions.php. As you can see this code sets all the post types you would like to have displayed by using the pre_get_posts filter. I think using the filter would be great but currently it breaks the new menu’s in WordPress 3.0.

add_filter( 'pre_get_posts', 'my_get_posts' );

function my_get_posts( $query ) {
	if ( is_home() )
		$query->set( 'post_type', array( 'post', 'page', 'album', 'movie', 'quote', 'attachment' ) );

	return $query;
}

So to add your custom post types into the your blog homepage you can put this code just before the WordPress post loop. The following code adds in the post types you would like to use and also checks to make sure your paging still works.

array( 'post', 'linkpost'),'paged'=>$paged ) );
}
?>

if you want to read more about the first piece of code you can check it out on Justin Tadlock’s blog.

WordPress Hosting

Think2Loud had been on shared hosting for just under two years, before I finally decided to take the leap and set up my own server. A few months ago I was reading a blog post by WooThemes about their new hosting setup. After reading about their insane hosting setup, I started doing a little research on VPS.net and came across a great article on Yoast.com about WordPress hosting. So going by what WooThemes had recently setup and what Yoast recommend, I moved Think2Loud to a VPS.net Cloud Server. I couldn’t be happier with the results. Not only does VPS.net have a great product for hosting WordPress but they are also extremely helpful and quick to respond to questions. So if you are looking for new hosting, be sure to check out a VPS.net Cloud Server.

VPS.net WordPress Hosting

Think2Loud doesn’t yet need the power that Yoast.com is running on. I got a VPS.net Cloud Server with the following setup on it, and what’s more, I did it all on my own. Yoast mentions in their WordPress article that if you buy 6 nodes or more, VPS.net will set you up with exactly what they have. Since Think2Loud currently only has about 15K visits a month, I couldn’t justify that much power. With some help from the VPS.net forums and following Yoast’s setup list, this is what I have running:

  • 1 Cloud Server at VPS.net, (2 nodes at the moment, tried 1 and there was just not enough RAM)
  • Centos with CPanel in the Atlanta cloud
  • replaced Apache with LiteSpeed (this really is easy )
  • installed APC so I could do database and output caching with the W3 Total Cache plugin
  • and of course a CDN. I went with MaxCDN because they were the best deal I could find

Pretty simple, right? Now there are a few things that I would like to share with you about VPS.net and the setup they have. I couldn’t find this info anywhere on the web but you may find it valuable. I know it made my day once I signed up and got started.

  • CPanel and WHM are monthly add-ons and VPS.net does the licensing.
  • LiteSpeed is also a monthly add-on and has a CPanel module. VPS.net also takes care of the license.
  • TThere is a small fee for there snapshot service. (Get it! you can never have too many backups).
  • I also setup Rsync on my server with the help of VPS.net. Again, there is a small fee, but it backs up everything.

That’s it! With just a little work, you can have one lean, mean, WordPress hosting machine. Be sure to check out the WordPress hosting article over at Yoast.com, and I would like to thank them for pointing me to a great hosting service.

How to see if a Post in WordPress has an Excerpt

On the single post page for our posts, we wanted to display the excerpt only if one had been entered. Since the built-in WordPress function to get the excerpt for a post will automatically generate one for you, we couldn’t just put the function in our post loop like what was done below.


	
>

Doing this causes the intro of the post to show twice, once from the auto-generated excerpt and once in the post content. To fix this, we added a quick check to the post loop. Simply replacing the_excerpt function in the post loop with this little piece of code removed the double intro.

post_excerpt) ) {
		//We have a excerpt so print it
		the_excerpt();
	} 
?>

Where to Start with jQuery Selectors

With jQuery there are many ways to select elements. We are going to cover two of the most popular selectors id and class.

jQuery uses the same selectors as CSS. This makes it very easy to select the elements you want to work with. The two most commonly used selectors are id and class. So before we start make sure you have your jQuery setup and the $(document).ready() function on the page.

Selecting by ID

This is best used when you want to target one specific element. The selector is exactly the same as what you would use to set styles for the particular element in CSS.

Selecting element with CSS and setting some styles.

#youridhere {
	display: none;
}

Now selecting the same element with jQuery and adding CSS styles.

$("#youridhere").css("display","none");

Selecting by Class

With the class selector you can select multiple elements at once. jQuery deals with multiple elements in a very simple manor. It returns an array of jQuery objects. With the way jQuery is designed it will automaticaly apply anything you do to your selection to all elements without having to loop threw the results.

Lets take a simples example of hiding all elements with a class of hide. To do this with CSS we would create the class in our style sheet like so:

.hide {
	display: none;
}

To do this same thing to all the elements with the class of hide in jQuery. You would use the following statement:

$(".hide").css("display","none");

This should get you started on the path of using jQuery in your projects. To read more about the selectors your can use in jQuery check out the documentation.

jQuery 101: Adding jQuery to Your Website

Everyone has to start somewhere. So lets get you setup to begin learning jQuery. The first thing you will need to do is get jQuery setup and running on your site. Now let’s get started.

The traditional jQuery Setup

1. Download the files

Make a trip over to the jQuery site and download the latest version or follow this link to the download page. You will want to grab the minified version of the code to save on bandwidth.

2. Add the script to your site

In the root folder of your site make a new folder called js. Then add the freshly downloaded jQuery script file to this folder. With the files in place you will need to add the script to your pages.

Open up one of you pages on your site and make you way to the head section of the page. Now copy the script tag below and paste in the head area of your files.


Once your script tag is in place you are ready to start using jQuery.

Using hosted files from Google

Google offers a great service. They host several of the most popular javascript library’s. This works well for sites that want to save on bandwidth or always have to latest code. Google offers several different ways to link to the script files. We are just going to use the direct link method. For more on the options of linking to these files check out the Google AJAX Libraries API.

1. Choose your version

There are a few options you have for choosing what version of jQuery you would like to link to. You can link to the main version of 1. This will keep your code updated to any subversions of 1. You could link to 1.3 this would keep your site running on the latest subversion of 1.3. Lastly you can link directly to the version you want to use.

Link to current subversion of version 1

http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js

Link to current subversion of version 1.3

http://ajax.googleapis.com/ajax/libs/jquery/1.3/jquery.min.js

Link to current version 1.3.2

http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js

Link to older version 1.3.1

http://ajax.googleapis.com/ajax/libs/jquery/1.3.1/jquery.min.js

2. Add the script to your site

I recommend you link to the current version that you know works with all of your code. So below is the script tag that you can place in the head section of your site. The script tag loads the current version as of this posting jQuery 1.3.2.


This will get you started on your path to learning jQuery. Look for more jQuery basics to come and also check out some of the resources listed below.

Harness the Power of the WordPress Post Class Function and Style Those Sticky Posts

The sticky post functionality in WordPress uses the post class function introduced in WordPress 2.7 to style your sticky post with css. In order to have your sticky posts styled different than your regular posts, you need to have the post class function in your theme within the post loop.

What is a sticky post and why would I use it?

A sticky post is a post that is plucked out from its publish date and moved to the front of your blog. This will keep the post on your homepage so you can increase the visibility of that post. Sticky posts have many uses–one would be if you were having a giveaway. You could stick that post to your homepage so everyone would see it when they visit your blog. Then, once the contest is over, you remove the sticky post option and the post falls back in line to when it was published.

Adding the post class function to your theme

Within the post loop there should be some code that looks something like what is below:

Rest of loop here

Now some themes use more than one class to style their posts. You could have a setup like the following where you have not only a post class but also a box class. Thankfully for you they have made it very easy to add that class into the post_class function.

Rest of loop here

To update the theme all we need to do is replace class=”post” with our function call. Your updated post loop will now look like.

> Rest of loop here

If you need that extra class like the second example that also uses the box class. All you need to do is pass that class name into the post class function.

> Rest of loop here

That is it for updating the code within your theme.

Adding style to your sticky post

The post class function will automatically add a class of sticky to any post marked as such in the post admin screen. So in your style sheet you will need to add some styles for this new class. Here we just added a different background color to our sticky posts.

.sticky{
	background-color: #c2c2c2;
}

Marking a post as sticky

stick-post-edit-window.png

In WordPress 2.8, make your way to the edit screen for the post you would like to make sticky. You’ll then see a box like the one to the left with the visibilty section closed. Click the edit link and you will now see the checkbox. That’s all it takes to take advantage of sticky posts in WordPress.

Be sure to check out the WordPress Codex to find more info on all the functions available in WordPress.

8 Must-Have WordPress Plugins to Improve SEO, Speed, and Security

Plugins are one of the things that make WordPress great. You can easily extend the functionality of WordPress without having to know much about PHP.

These “Must-Have” plugins are ones that I find myself using over and over again. The base installation of WordPress is an impressive piece of software and with these plugins, you can take it to the next level. Get your WordPress site running faster, backed up, secure, and search engine optimized with these 8 plugins in minutes. Just a little effort on your part to set up these plugins will go along way to improving your blog’s traffic.

All-in-One SEO Pack

Whether or not you are an SEO expert, this is a simple-to-use plugin. The All-in-One SEO Pack plugin optimizes your WordPress blog to help you get the most out of your content.

DB Backup

Download or email your backup with ease. You can backup and restore almost anything stored in your WordPress database.

Google Analyticator

With the ability to add your Google Analytics stats right to your WordPress Dashboard, this plugin is an easy way to track and view all those stats you like to see.

Google XML Sitemaps

It doesn’t get much easier than this to help Google and other search engines find all of your content. Simply install this plugin and generator your XML-sitemap. The plugin will generate a new sitemap every time you add new content.

WP-PageNavi

Add more advanced paging to your WordPress blog without having to know PHP.

WP Security Scan

Scans your WordPress installation for security risks and makes recommendations on how to fix them.

WP Super Cache

Speed kills–well, a lack of speed does anyway. This plugin generates static html files of your WordPress pages and can greatly improve load times.

Yet Another Related Posts Plugin

Helping you increase those page views. This plugin gives you the ability to show your readers related content on your site.

Something I missed? Let me know–I am always on the lookout for a good plugin.