For all of those businesses large and small who might be worried their rankings will simply tank just from changing their hosting company can now sleep at night. Coming from Matt Cutt’s mouth he claims that changing your hosting company will not affect your SEO in any sort of way. This is assuming that you [...]
For all of those businesses large and small who might be worried their rankings will simply tank just from changing their hosting company can now sleep at night. Coming from Matt Cutt’s mouth he claims that changing your hosting company will not affect your SEO in any sort of way. This is assuming that you are moving to a quality hosting company and not to a server that is jammed up with other spammy websites. Changing a hosting provider can be a very scary moment for many businesses especially when your entire livelihood depends on your website. Any problems could put your sales for that day or week in a very tricky and dangerous situation.
Here is the video from Matt Cutts about Changing Your Hosting:
Always try moving your website to a quality hosting company. It might not directly reflect your rankings but you never want your company website to share a server with a handful of websites that might have slightly frowned upon services. If one of those website carries a virus onto the server the server could ultimately go down for some period of time.
If you are in the business of offering a search engine optimization services to the public, you will most likely completely understand where I am coming from as I write this blog post. Before I continue, I want to point out, that I love what I do, working with clients to help build their businesses [...]
If you are in the business of offering a search engine optimization services to the public, you will most likely completely understand where I am coming from as I write this blog post. Before I continue, I want to point out, that I love what I do, working with clients to help build their businesses through SEO and SEM.
At some point the industry veered off course because some clients look at you like you are the enemy right from initial phone call. I view at each client like a partner, I have been hired to grow their business and my only goal is to do just that. I think this is important to discuss because it seems to be getting worse for many other search engine marketing professionals. I know the past 12 to 24 months has been tough for all of us, but there is not excuse! Anyway, I encourage SEO folks, marketers, web developers, web designers and clients to read and contribute your thoughts and experiences to this blog post. In my opinion, here are a handful of some of the top characteristics that a bad SEO client portrays:
1. Poor Communication: A large bottleneck that quite often occurs is a lack of response or communication from a client. When you set up scheduled meetings and consistently get blown off this will eventually lead to a much larger problem. Search engine optimization often times requires education and reasoning as to why an effort is being done and these meetings are vital for things to keep moving smoothly. In order for no surprises to ever occur, client, service provider communication is essential. A lack of communication from either party usually leads to loss of business.
2. Poor Company Organization: Have you ever worked with a company that couldn’t get out of its own way? Nothing is worse than having to get approval from 6 different people about let’s say, on site optimization recommendations. Often times this leads to numerous unnecessary revisions by company employees that have no business looking at this in the first place. For instance and IT Director and Sales Director really have no need to be involved. There should be one point of contact to allow for things to operate smoothly and efficiently. Too many chefs in the kitchen usually spoils the soup.
3. We are NOT the Enemy: Plain and simple your SEO service provider is NOT the enemy. We have been hired to complete the job of helping you build your business online through a variety of sources and efforts. Some clients approach purchasing SEO services like insurance. Nobody wants to buy insurance but we have to. Yes SEO is intangible but results can be seen from month to month and over time. Treating us like we are against you right from the start is not going to create a smooth relationship. Actually it will be quite the opposite and it will be rocky from the beginning.
I just made a major change for me and 301′d PatrickGavin.com to Searchengineoptimization.net The focus of this site moving forward will be more of a SEO resource than my personal blog so I wanted a name that says this loud and clear. I wanted to kick off the new site (new design coming soon btw) [...]
I just made a major change for me and 301′d PatrickGavin.com to Searchengineoptimization.net The focus of this site moving forward will be more of a SEO resource than my personal blog so I wanted a name that says this loud and clear. I wanted to kick off the new site (new design coming soon btw) with a quick guide on how to properly 301 a domain. If you would have done anything differently please let me know in the comments! In the end, the judge will be Google and how it handles this 301.
Goal is to 301 redirect www.abc.com to www.123.com
1. Register both www.abc.com and www.123.com with Google webmaster tools. Note that you will have to insert a snippet of code or upload a file to both of your sites to verify you do own or control both websites.
2. Make sure www.123.com takes on the exact design, look and feel, etc of the original www.abc.com site. This is important as Google doesn’t like too much change going on at once. Keep the design the same during a 301 so you don’t throw too much change at Google at once.
3. Make sure you keep the url structure the same, ie www.patrickgavin.com/2009/04/19/april-sandbox-update/ should be moved to www.searchengineoptimization.net/2009/04/19/april-sandbox-update/
4. Follow Google’s steps technical guidelines on completing a 301
5. Double check your redirects. Use a 301 redirect checker to make sure your redirects are seo friendly (http://www.internetofficer.com/seo-tool/redirect-check/). Also, test a handful of urls from your old domain to make sure they are getting redirected properly. You can easily do this by googling your old domain name and clicking through your sites indexed pages. Be very sure that every single page of your old domain is getting redirected to another active page at your new domain. You definitely don’t want to be left with a bunch of 404 not founds. Additionally, it is recommended that you chose to redirect everything to either the www or non-www version of your new domain.
6. Let Google Webmaster Tools know about the 301 by submitting a "Change of Address" request.
7. After the 301, it is highly recommended you build some strong links and add some content to the blog to show the site is still active & growing. If you want to go further, have some of your old incoming links update their link to point to the new site (this is not required, but it shows that the sites that linked to you before still want to link to you now indicating it’s the same site as before). Remember Google logs redirects just like they log your backlink data so don’t rely on 301’s as your sole link strategy.
8. Wait patiently and have some faith! Your original site can disappear for a period of time from Google’s index leaving you with NOTHING for a period of time. This could be days or weeks. What should happen is the new site you 301′d to should appear taking on similar rankings that you had for your original site give or take a few spots up or down.
Now we will wait and see what happens with my 301 and I will keep you updated. The PatrickGavin.com domain is currently ranking #6 for the coveted "search engine optimization" query so this is a bit of a gamble and it will be fun to see if it pays off!
UPDATE!+3 days after the 301. My PatrickGavin.com site has lost all Google keyword rankings! I have lost all rankings including #1 for "patrick gavin" #6 for "search engine optimization", etc. Here is the good news: this is what happens when you do a 301. Fingers crossed but the SearchEngineOptimization.net domain should* reappear in the coming days/weeks…
Back in July, “Power Tips for WordPress Template Developers” presented 8 basic techniques for adding popular features to the front end of a WordPress-powered website. The premise was that WordPress has become an elegant, lightweight content management solution that offers the fundamentals out of the box, atop a modular core that offers incredible potential in the hands of a capable developer.
WordPress does not try to be an “everything to everyone” CMS right out of the box. Many systems do an average job incorporating 99% of what the potential CMS market might need, even if the last 15-20% is used only by a fraction of the market and adds considerably to the system’s overall “heft” (or bloat). At the other end of the spectrum are completely custom solutions that are finely tailored to exact needs, at the cost of reinventing wheels like polished content editing with media management and version control.
That previous “Power Tips” entry scratched the surface, covering a handful of API calls mixed in with some simple PHP code and configuration tips intended to help beginner WordPress template developers kick their game up a notch. This article takes power tips to the next level, expanding on some of the topics in the first article, and introducing more advanced techniques and methods for customizing not only the front end, but the content management (or back end) experience.
width="650">
width="650">
style="width:650px;">
src="http://creatives.commindo-media.de/static/smashing-magazine-advertisement.gif" alt="Smashing-magazine-advertisement in Advanced Power Tips For WordPress Template Developers" border="0" />
/>
href="http://creatives.commindo-media.de/www/delivery/ck.php?zoneid=56" >
src="http://creatives.commindo-media.de/www/delivery/avw.php?zoneid=56" border="0" alt=" in Advanced Power Tips For WordPress Template Developers" />
href="http://creatives.commindo-media.de/www/delivery/ck.php?zoneid=63" >
src="http://creatives.commindo-media.de/www/delivery/avw.php?zoneid=63" border="0" alt=" in Advanced Power Tips For WordPress Template Developers" />
href="http://creatives.commindo-media.de/www/delivery/ck.php?zoneid=64" >
src="http://creatives.commindo-media.de/www/delivery/avw.php?zoneid=64" border="0" alt=" in Advanced Power Tips For WordPress Template Developers" />
src="http://imp.constantcontact.com/imp/cmp.jsp?impcc=IMP_DIMPBPRSMASHRSS&o=http://img.constantcontact.com/lp/images/standard/spacer.gif" alt="Spacer in Advanced Power Tips For WordPress Template Developers" border="0" width="1" height="1" />
/> Back in July, “
href="http://www.smashingmagazine.com/2009/07/02/power-tips-for-wordpress-template-developers/">Power Tips for WordPress Template Developers” presented 8 basic techniques for adding popular features to the front end of a WordPress-powered website. The premise was that
href="http://www.wordpress.org">WordPress has become an elegant, lightweight content management solution that offers the fundamentals out of the box, atop a modular core that offers incredible potential in the hands of a capable developer.
WordPress does not try to be an “everything to everyone” CMS right out of the box. Many systems do an average job incorporating 99% of what the potential CMS market might need, even if the last 15-20% is used only by a fraction of the market and adds considerably to the system’s overall “heft” (or bloat). At the other end of the spectrum are completely custom solutions that are finely tailored to exact needs, at the cost of reinventing wheels like polished content editing with media management and version control.
The self-proclaimed WordPress “code poets” have, alternatively, focused on doing an A+ job with the “fat middle”: the 80-85% of features that almost everyone needs, and coupling those with a first rate framework and API that enables capable developers to add in almost any niche or “long tail” feature. In fact, the core WordPress framework is so capable that a handful of
title="WordPress frameworks" href="http://www.smashingmagazine.com/2009/05/27/wordpress-theme-development-frameworks/">“intermediary” frameworks that sit on top of it have already emerged.
That previous “Power Tips” entry scratched the surface, covering a handful of API calls mixed in with some simple PHP code and configuration tips intended to help beginner WordPress template developers kick their game up a notch. This article takes power tips to the next level, expanding on some of the topics in the first article, and introducing more advanced techniques and methods for customizing not only the front end, but the content management (or back end) experience.
You may be interested in the following related posts:
href="http://www.smashingmagazine.com/2009/07/02/power-tips-for-wordpress-template-developers/">Power Tips for WordPress Template Developers
href="http://www.smashingmagazine.com/2009/05/13/10-custom-fields-hacks-for-wordpress/">Custom Field Hacks for WordPress
href="http://www.smashingmagazine.com/2009/11/25/2009/03/04/15-useful-twitter-plugins-and-hacks-for-wordpress/">15 Useful Twitter Hacks and Plugins For WordPress
href="http://www.smashingmagazine.com/2009/11/25/2009/05/18/100-amazing-free-wordpress-themes-for-2009/">100 Amazing Free WordPress Themes For 2009
Multiple Column Content Techniques
The average blog or website has a single, clearly defined block of space for a given page’s or post’s unique content. But there are plenty of creative websites that don’t conform to this simple notion of “one unique block” per page. A creative online portfolio layout might feature a screenshot and project description in a left column, and a list of technologies used in a right column. Both the left and right column are unique to each portfolio page.
Here’s a screenshot from an in-development website project, built on WordPress. The “projects” area features portfolio-like layouts of green building projects throughout the state. In addition to a specially designed gallery visualization, note that the individual project profile has two distinct columns.
class="alignnone size-full wp-image-19110" src="http://media.smashingmagazine.com/cdn_smash/wp-content/uploads/2009/11/rigbc-2-column.jpg" alt="Rigbc-2-column in Advanced Power Tips For WordPress Template Developers" width="500" height="478" />
A more commonplace layout might feature an obvious, primary block of page content, but also feature a sidebar element that is unique to the current page: maybe a quote from a customer about a specific product or service. The
href="http://www.smashingmagazine.com/2009/07/02/power-tips-for-wordpress-template-developers/">“Power Tips” article offered a method to associate sidebar elements with multiple pages using custom fields and page IDs (tip #6). That approach isn’t very effective or efficient for designs with a 1:1 relationship between sidebars and pages (where each page has a unique sidebar element).
href="http://www.smashingmagazine.com/2009/07/02/power-tips-for-wordpress-template-developers/">
class="alignnone size-full wp-image-19111" src="http://media.smashingmagazine.com/cdn_smash/wp-content/uploads/2009/11/sidebars.jpg" alt="Sidebars in Advanced Power Tips For WordPress Template Developers" width="500" height="206" />
Yes, the developer could
href="http://wordpress.org/extend/plugins/mce-table-buttons/">add table buttons to the WordPress editor, and let content authors fend for themselves: a solution prone to problematic layouts and bad output relied upon far too often. Here are a few simple options that keep layout in the hands of the template developer while making content management easier and problem-free.
Short, simple, and HTML free? No worries.
Before we delve into solutions that assume a need for HTML formatting in this second content block, let’s review a more basic solution. If the second column does not need to be formatted – or maybe should not be formatted by the editor for design reasons – then a simple custom field will do the trick. In the case of a simple sidebar element, like a customer quote, this may be just the trick.
There are already
href="http://www.kriesi.at/archives/how-to-use-wordpress-custom-fields">great tutorials and
href="http://www.smashingmagazine.com/2009/05/13/10-custom-fields-hacks-for-wordpress/">useful custom fields hacks that walk through the WordPress custom fields feature, so if you are not familiar with the basic idea behind custom fields, start there. Let’s go ahead and create a custom field named “sidebar_content” (also known as the “key”), and put some simple content in there. Just to shake things up, let’s assume we do need a very basic HTML feature for our content authors, who know nothing about HTML: line and paragraph breaks. Let’s also assume that we want to format this sidebar content on the front end with some of the basic automatic niceties we get when we output post content, like curly quotation marks.
class="alignnone size-full wp-image-19114" src="http://media.smashingmagazine.com/cdn_smash/wp-content/uploads/2009/11/sidebar-custom-field.gif" alt="Sidebar-custom-field in Advanced Power Tips For WordPress Template Developers" width="500" height="236" />
Here’s how we can output this in any template file, using the
href="http://codex.wordpress.org/Plugin_API/Filter_Reference/the_content">“the_content” filter to apply the WordPress content filter to our custom field. That filter converts single line breaks to break tags, double line breaks to paragraphing tags, and even transforms simple quotation marks to curly quotes!
Of course, we can make this even more intuitive for the content authors by creating a new meta field box for sidebar content instead of relying on the generic “custom fields” box… which will be covered later in this article!
Using the More Tag for… More
The WordPress editor has a button “more tag” button that is primarily intended to separate “above the fold” content from “below the fold” content. If you are not already familiar with the “more” divider,
title="WordPress more divider" href="http://codex.wordpress.org/Customizing_the_Read_More">read up on that first.
If the pages or posts that need a two column layouts also rely on traditional more separation, this tip will most likely not be effective, unless one of the columns is also the intended “above the fold” content. However, most instances where a two column layout is desirable don’t overlap with a traditional above / below the fold need. It is fairly rare, for instance, for pages (vs. posts) to actually make any use of the more tag. So let’s start taking advantage of that feature!
The basic idea is that content above the more divider will represent one block of HTML content, while content below the divider will represent a second block (be it a sidebar element or column).
class="alignnone size-full wp-image-19133" src="http://media.smashingmagazine.com/cdn_smash/wp-content/uploads/2009/11/sidebar-using-more-tag.gif" alt="Sidebar-using-more-tag in Advanced Power Tips For WordPress Template Developers" width="500" height="286" />
Here is how to retrieve content above and below the more divider as separate blocks of HTML content in the corresponding page template file.
The global “more” variable lets WordPress know whether or not the content is being rendered in an “above the fold” (or “teaser”) only view. By passing an empty string to
href="http://codex.wordpress.org/Template_Tags/the_content">“the_content”, we prevent a “read more” link from showing up below the HTML content. And, for column two, we pass a second parameter to “the_content” – true – which instructs WordPress to output the content without the teaser.
If the intent is to output the second block of content outside of the loop in another template element, such as a sidebar, this approach is a bit trickier. One option would be to store the second block of content in a uniquely named variable, declare it as a global variable in the sidebar, and – if there is any content inside the variable – output a new block. An alternative could involve checking which page template is in use with the
href="http://codex.wordpress.org/Conditional_Tags#Is_a_Page_Template">“is_page_template” function, and, if the two column template is in use, calling “the_content” with the second parameter set to true, as in the example above.
The Plug-in Solution: Adding a Second HTML Content Block to the Editor
The ideal solution, of course, might be a second HTML editor field on the WordPress page or post editor. Unfortunately, no such plug-in existed… until recently! While writing this article, we decided it was time such a solution did exist, and so the author of this article is happy to present a free, open source plug-in that combines some savvy understanding of how TinyMCE works (hint: it’s as simple as a class name) with the custom meta box tutorial covered later in this article, and a little bit of extra customization and polish thrown into the mix.
href="http://wordpress.org/extend/plugins/secondary-html-content/">Secondary HTML Content adds a second HTML editor to pages, posts, or both (customizable with a simple settings panel). You can output the content in a sidebar with an included widget, or integrate it more tightly with the template by using “the_content_2″ and “get_the_content_2″ functions.
href="http://wordpress.org/extend/plugins/secondary-html-content/">
class="alignnone size-full wp-image-19137" src="http://media.smashingmagazine.com/cdn_smash/wp-content/uploads/2009/11/secondary-html.jpg" alt="Secondary-html in Advanced Power Tips For WordPress Template Developers" width="480" height="529" />
Associating Pages with Post Content: Reloaded
href="http://www.smashingmagazine.com/2009/07/02/power-tips-for-wordpress-template-developers/">“Power Tips” covered the basic foundation for associating different WordPress pages with different post categories. The basic premise was that many sites require, effectively, different post “feeds” on different pages. For instance, there may be a company blog, but there may also be an independent news feed.
This continuation offers specific tips that extend the core concept introduced in part 1, making it easier to have multiple page / category associations, preventing entrance into the “real” category archive, and ensuring that individual post views retain a visual and architectural association with their parent “category page” layout.
Be sure to
href="http://www.smashingmagazine.com/2009/07/02/power-tips-for-wordpress-template-developers/">read part 1 before proceeding.
A Review of the Basics & the Two Fundamental Approaches
At the heart of the category / page association (covered in part one) was:
A matching of the “page slug” with the “category slug.”
Using “
href="http://codex.wordpress.org/Template_Tags/query_posts">query_posts” and the category parameter to exclude standalone page categories from the primary feed
Using a dedicated page template with “query_posts” and the “category name” parameter to create a page featuring a feed for a single category.
class="alignnone size-full wp-image-19139" src="http://media.smashingmagazine.com/cdn_smash/wp-content/uploads/2009/11/wp-cat-config.gif" alt="Wp-cat-config in Advanced Power Tips For WordPress Template Developers" width="500" height="333" />
Before delving into the tips that extend those ideas, it is important to make a distinction between two common but fundamentally different use cases for page / category association. The more typical use case, which the first part was tailored to, is a website that has a primary feed, like a blog, but also has one or two distinct feeds, most often for a formal news or press feed.
The second use case is a bit more esoteric: there is no primary feed. The site has many pages, and many (but not all) of those top level pages are individual feeds of posts. The example, at the end of this power tip,
href="http://www.m62.net">m62.net, is one such use case. Another common use case might be – again – a portfolio centric website.
Let’s say we want to create “Joe’s Portfolio”, and Joe wants to feature 4 distinct areas of expertise. Each area of expertise should be a top level page, say, joes-portfolio.com/web-design, joes-portfolio.com/graphic-design, etc. Joe wants to have a little write-up about each service area at the top of the page, followed by a feed of case studies. Why a feed instead of sub-pages? Maybe Joe wants prospects to be able to subscribe to an RSS feed for each area of expertise; maybe he wants to easily cross-tag case studies based on industry; maybe he plans to update frequently and doesn’t want a huge page sitemap or wants visitors to page through a date-organized collection of case studies. There are many reasons to use posts instead of pages.
The following tips provide solutions for both use cases.
Automatically Determining the Page / Category Association
Part one suggested that a unique page template be created for any page associated with a category. That page template would then query for posts using a hardcoded category name or category ID. If there are only one or two standalone “category pages”, this is an efficient and effective solution.
However, if there are many page / category associations, as in use case #2 (no primary feed), the process of manually creating page templates for each association is tedious to build and maintain, and not realistic if content editors who don’t program need to be able to create more page / category associations on demand.
An alternative would be to
href="http://codex.wordpress.org/Pages#Creating_Your_Own_Page_Templates">create a generic page template, let’s say “template-category-connector.php”, that is assigned to all pages associated with a category, and automatically determines the right category to query.
The following code performs the matching and executes the post query. The magic happens by taking advantage of our matching page and category slugs. Once again, if the website does not use permalinks, an alternative approach will be required (one permalink-free alternative could involve a custom field with the associated category ID).
That’s all there is to it… just proceed on with the
href="http://codex.wordpress.org/The_Loop"> post loop to output the applicable category’s posts. Note that the template should probably check for an actual return value from line 1, and output a graceful error in the event there is no match.
Handling Entry into the “Real” Category Archive
Now that there is a dedicated page layout that handles the category feed, we will want to be make certain that the visitor doesn’t land on WordPress’ default category “archive” view. For instance, when using permalinks with the default “category base” value, the archive view for a category with a top level category assigned a “web-design” slug would be: mysiteurl.com/category/web-design. However, the intent is for visitors to view this category at our top level page: mysiteurl.com/web-design.
By combining the WordPress category template file with some smart redirects, we can prevent entry into the default category archive. Out of the box, the
href="http://codex.wordpress.org/Template_Hierarchy#Category_display">WordPress template system allows developers to create global category archive templates as well as templates for individual category archives.
If we are in use case #1 – a site with a traditional blogfeed and a standalone news feed on a “press releases” page – we will want to use the latter solution. Let’s say, as in part one, the category ID for “press releases” is 5. We create a template file in our theme folder named category-5.php. Under use case #2 (no primary feed), we will want to redirect all category archive traffic, in which case we need to work with the category.php template file.
A few lines of code in either template file will redirect visitors to the right place. We’ll also pass
href="http://www.checkupdown.com/status/E301.html">HTTP error / redirect code “301″ – which will tell search engines to permanently redirect their link to the right location. Note that this particular code assumes we are using a permalink configuration. Line 2 can be modified to accomodate that situation.
In effect, that code removes the category base (”/category” by default) from the overall relative URL, and
href="http://codex.wordpress.org/Function_Reference/wp_redirect">safely redirects the visitor to the page with the matching slug. Of course, if the site falls under use case #1 (one or two stand alone feeds), the line three could dropped into a specific category template (i.e. category-5.php) with a hardcoded absolute URL for the redirect destitation.
Hiding Standalone Categories from the Category List & Primary Site Feed
In the first use case (only isolating one or two categories from a primary feed), it may be necessary to prevent isolated categories or the posts within those categories from appearing in some common theme elements that would traditionally include them.
Consider the example from part one: a site with a traditional blog and a standalone press release feed. Assume the owners of the site want the RSS feed for the blog to be persistently available throughout the site (typically manifesting itself as an RSS icon in the browser location bar), but don’t want the press release items included in that primary feed. By default, the WordPress primary feed is available at “/feed”, and includes all published posts, regardless of category or any other post property.
href="http://www.smashingmagazine.com/feed">
class="alignnone size-full wp-image-19147" src="http://media.smashingmagazine.com/cdn_smash/wp-content/uploads/2009/11/smashingmag-feed.gif" alt="Smashingmag-feed in Advanced Power Tips For WordPress Template Developers" width="500" height="212" />
To exclude categories from the primary RSS feed, we need to
href="http://codex.wordpress.org/Function_Reference/add_filter">filter the WordPress function that retrieves the posts. Let’s again assume that the category ID for Press Releases is 5. The following code should be placed in the template’s
href="http://codex.wordpress.org/Theme_Development#Theme_Functions_File">“functions.php” file.
add_filter('pre_get_posts','exclude_press');
function exclude_press($query) {
if($query->is_feed && !$query->is_category) $query->set('cat','-5');
}
To summarize, we use the “pre_get_posts” filter to modify the post query before it executes. Within a new filter – named “exclude_press” – a conditional confirms that the post query is for a feed, and that the query is not for an individual category. If the check pans out, the query is modified to exclude category 5 before execution.
The notion of globally filtering the post query may have broader implications depending on the site’s unique requirements. With some smart conditional checking, the filter could be extended to prevent the category from appearing anywhere except within the category or isolated post view. But be careful when extending the filter, and be sure to consider all possible views, including administrative views!
The category list is another frequently used site element that isolated categories should, in most cases, be excluded from. If the template
href="http://codex.wordpress.org/Template_Tags/wp_list_categories">calls the category list in only one or two places by code (as opposed to using the categories widget),
href="http://codex.wordpress.org/Template_Tags/wp_list_categories#Include_or_Exclude_Categories">excluding categories from the list is straight forward.
wp_list_categories('exclude=5');
However, if the categories widget is in use, or the category list is used throughout the template, an alternative approach is required. Enter the “list_terms_exclusions” filter. Again, the following code should be placed in the “functions.php” template file.
add_filter('list_terms_exclusions', 'filter_press');
function filter_press($exclusions) {
$exclusions .= " AND t.term_id != 5 ";
return $exclusions;
}
The return value of a “terms exclusions” filter is tacked onto the “where” clause in the SQL query that retrieves the terms. Without digging too deep here, the reason for discussing “terms” as opposed to, say, “categories” is because WordPress abstracts a variety of different taxonomies (link categories, post categories, tags, custom taxonomies, etc) into a unified database model that handles all taxonomies. Calls to “get categories”, “get tags”, and so forth, are all referring back to general “terms” behind the scenes. Ever wonder why category, tag, and other IDs tend to jump around? They are all being added to the same table. Assuming a fairly clean install, try adding a new post category, and note the ID. Then add a tag, and note its ID… one greater than the new post category.
class="alignnone size-full wp-image-19149" src="http://media.smashingmagazine.com/cdn_smash/wp-content/uploads/2009/11/term-taxonomies.gif" alt="Term-taxonomies in Advanced Power Tips For WordPress Template Developers" width="482" height="166" />
Retaining the Page Layout for Post Views within a Category Page
One of the most common challenges to tackle with page / category association is retaining a sense that the visitor is still within the “category page” hierarchy – and not a global feed hierarchy – when a visitor is reading an individual post. Part one hinted at this challenge under “The devil is in the details,” and started to suggest a path that incorporated using the “in_category” function. We will explain how to use “in_category” within templates, as well as how to trick functions that reference the original query object into thinking that they are “within” the category page.
Let’s start with case #1, and building on the example in the first article, assume we only need to contend with one isolated feed, “Press Releases” (category ID 5).
Say the theme has a sidebar template that lists post categories when rendering the blog part of the site, and when rendering a standalone page, shows a page list instead. Here’s an extremely simplified version of what that might look inside the sidebar template file.
if (is_page())
{
wp_list_pages();
}
else
{
wp_list_categories();
}
Of course, there may be alternative widget sets for pages or posts, and there is likely to be more than just one element in the sidebar. But the concept should hold. Now going back to the example, the theme should render posts in category 5 (Press Releases) as if the visitor were on a page (not the blog). Leveraging the “in_category” check, the code above would now like the following:
Note that if there are multiple categories whose posts should resemble page output, the “in_category” function should be passed an array of IDs, like so:
in_category(array(5,7));
The need for a “in category” check is probably moot in case #2 (multiple page/category associations, without a primary feed): the template is probably structured to output the same elements on pages and posts from the get go. In other words, everything is handled as if it is a page since there is no primary feed. However, the following tip – that dynamically looks up the faux parent page ID (the page associated with the category) – is necessary for the next part of this tip. Just amend the code to check if “faux_parent_page” has a valid value: if it does, then the post is inside an isolated category associated with a page.
Once again, this approach to dynamically seeking the faux parent page (the category page) depends on taking advantage of the matching permalink structure between post categories and pages that is at the heart of this association. If the site is unable to use permalinks, a more complex alternative look up of the faux parent page will be necessary.
Now that we have the ID of the category’s associated page, we can trick “black box” theme elements that determine page or post properties on their own (by referencing the post query) into thinking they are actually working with the category page.
The most common use case is page navigation. Whether its breadcrumbs, a top level page menu that should retain “current” (on) states, or a side navigation menu that should display the current section, there are many “black box” navigation functions that need to be tricked into rendering themselves as if on the category page.
Let’s use a simple top level page list, which should maintain proper “current_page”, “current_page_parent” (and so on) classes when on a post under a category page. Here’s what that simple function might look like before our changes:
wp_list_pages('depth=1');
Of course, posts do not normally have parent pages, so there will be no “current” classes assigned to that output when reading a post. Here is how to trick that function into thinking it is rendering the navigation for the “parent” category page.
//retrieve faux parent page dynamically… can skip and hard code in case 1
foreach(get_the_category() as $category) {
$faux_parent_path = '/'.get_category_parents($category, FALSE, '/', TRUE);
}
$faux_parent_page = get_page_by_path($faux_parent_path)->ID;
//reset the post query as if on the faux parent page
query_posts('page_id='.$faux_parent_page);
//execute our "faked out" function
wp_list_pages('depth=1');
//reset the query back to the initial state
wp_reset_query();
If there are multiple elements that need be “tricked,” a best practice would be to put the “faux parent page” retriever at the top of the template, and declare it a global in any template files that need it. This would avoid repeated look ups of the faux parent page.
An Example: Seeing it All Put Together
A great example of a WordPress-powered CMS that pushes use case #2 to its limits can be seen at the home of m62 visual communications, at
href="http://www.m62.net/">http://www.m62.net.
href="http://www.m62.net/powerpoint-templates/pharmaceutical-templates/">
class="alignnone size-full wp-image-19151" src="http://media.smashingmagazine.com/cdn_smash/wp-content/uploads/2009/11/m62-pharm.gif" alt="M62-pharm in Advanced Power Tips For WordPress Template Developers" width="500" height="392" />
All of the navigation items across the top (Presentation Theory, PowerPoint Slides, etc) are pages associated with post categories. The sub-navigation on the right contains sub-pages that are also associated with sub-categories. For example, in the screenshot above (
href="http://www.m62.net/powerpoint-templates/pharmaceutical-templates/">available here), the visitor is on the “Pharmaceutical Templates” page (faux category), which is a child of the “PowerPoint Templates” page (also a faux category). The content starting with “Download free” (below the page title) is the content from the “Pharmaceutical Templates” page. The posts below the “Next Steps” bar, titled “Latest in Pharmaceutical Templates”, are the posts inside that category. The applicable related category is automatically discovered by the WordPress template, populating the category name “Latest in X” and recent posts. Now let’s look at one of the posts inside that category.
href="http://www.m62.net/powerpoint-templates/pharmaceutical-templates/atoms-template/">
class="alignnone size-full wp-image-19152" src="http://media.smashingmagazine.com/cdn_smash/wp-content/uploads/2009/11/m62-post.gif" alt="M62-post in Advanced Power Tips For WordPress Template Developers" width="500" height="371" />
Using the tips outlined above, the individual post retains the feel of being within the “Pharmaceutical Templates” page, right down to the breadcrumb navigation and “current” states in the navigation.
But not only does m62.net use category / page associations for most top and second level navigation items, it actually extends the concept to tags. The 5 “tabs” on the top right actually represent post tags, and each has a “tag page.”
Stay tuned!
The second part of the post will be published here, on Smashing Magazine, in two weeks. Hence, you may want to
href="http://rss1.smashingmagazine.com/feed/">subscribe to our RSS-feed and
href="http://twitter.com/smashingmag">follow us on Twitter. Any ideas or suggestions? Comment on this article!
Today’s SEO tip is about using citation and search modifiers to find creative solutions for link building. Citation (a websites footprint or popularity matrix) is a prominent principle used by search engine algorithms to assess importance.
Hence, authoritative links in to the quantity or percentage of links out a domain has, determines how much link flow [...]
Today’s SEO tip is about using citation and search modifiers to find creative solutions for link building. Citation (a websites footprint or popularity matrix) is a prominent principle used by search engine algorithms to assess importance.
SEO Tips to Find and Qualify Directories
Hence, authoritative links in to the quantity or percentage of links out a domain has, determines how much link flow a domain can produce in tandem with its contained volume of content.
Popular websites with user generated content are always ahead of the supply and demand curve, because they always have something new for search engine spiders to dig into, which keeps them coming back for more in addition that they also receive a healthy flux of inbound links.
Wikipedia is a prime example of a website with a 94% deep link percentage and all user generated content with millions of relevant themed pages and subjects.
Directories of that magnitude may not exist, but you can find smaller more potent themed directories to acquire links to your homepage or more importantly deep links to individual pages with keyword-rich anchor text that pass just as much value.
On the contrary, websites that constantly link out, offer bleak editorial value or are dripping with commerce laden jargon often do not make the grade when it comes to developing an authoritative domain. When picking potential directories to submit your site, you should focus on quality and relevance rather than bulk submissions.
There are only a handful of directories that have kept a clean link profile as a result of a human review editorial process. In addition to the neighborhood of a website, you can also use off page citation as a measurement of if that directory is worthwhile for submission.
Search engines scan their index for duplicate, so vary your title and descriptions for more impact. Use other websites as a yardstick to assess how authoritative a domain might be.For example, using Alexa ranking as an indicator could signify what type of imprint that domain has. Another great website you can use as a yardstick is DMOZ.
If a site appears there, in most cases you know it has passed a stringent editorial review and has been around for some time. You can also visit DMOZ and just use their search box and type in keywords (topic) directories such as legal directories, shopping directories, etc. and find dozens or hundreds of hard to find pre-qualified directories for consideration.
Another method is to use the *wildcard technique in a Google search such as:
Google will fill in the blanks based on authority and return a list of top domains that feature related searches based on the shingles (words) used in the query.
Or you can even search for
www directories or
www AND legal directories (just replace the word legal with your category).
If you just typed www into a Google search box, it would list the most powerful sites online in chronological order based on citation. By adding the word “directories” to it you are adding a modifier for the information retrieval parameter to lock on to and return relevant results.
Cut down scrolling time by using http://www.google.com/ie?&num=100 first to view 100 results at a time or just click your advanced options in Google and switch results to 100 (to view descriptions and meta snippets in addition to titles).
Then by context alone you can skim for relevant directories to add your website. Age, trust and authority are crucial elements here, not the submit your website to 1000 directories wild west approach.
Quality is the cornerstone of search engine result page longevity and combining this with deep links (links to specific pages) you can create buoyancy for pages nested deep under the surface in your website.
Another method is to add a modifier to the category such a:
Once again, replace your category in front of the word directories and see what the spiders have crawled and what is in the index as a potential link candidate.
Just replace the legal category with the one you are targeting to find the directories you are considering.
Next check to see if they are in Dmoz, Yahoo or Alexa and then check the PageRank of the homepage and sub category you are considering to determine crawl frequency and indexing.
If it hasn’t been crawled for a while, then it is more than likely penalized or the page suffers from link attrition and is not a good candidate for providing a link.
Also consider that the more links that are on the page, the smaller the percentage your site receives. Although you may not consider PageRank important, in this way, using it to assess crawl frequency and how much authority and citation a page has is not a bad idea.
Personally, I prefer using Majestic SEO to conduct a page level analysis of the AC rank (which is a much more straight forward metric), but to each their own.
Remember, as you develop your link profile, quality is better than quantity, so think before you link and remember, everything leaves a trail…