HeadSpace Plugin
| Download: | headspace.zip |
|---|---|
| Version: | 1.4 |
| Updated: | September 18, 2007 |
| Size: | 2 KB |
Support This Plugin!While this software is being provided free to use, it takes considerable time to develop and support. If you do find it particularly useful or want to request a feature then consider donating money as an incentive for me to carry on developing it. Thanks! |
|
| I have other plugins too! | |
Style-sheets are great and have completely transformed the web. WordPress is great too, and also happens to make extensive use of style-sheets, as do the many plugins and hacks that are available for it. This leads to a small problem: any plugin that requires style-sheet definitions must have them added to the main WordPress style-sheet. This is not a good thing for several reasons:
- It's bad design to have a plugin modifying the main theme
- If you change theme, you need to make the changes all over again (if you can remember what they were)
- If you delete the theme then you have a lot of styles you don't need any more.
I initially created a basic style-sheet plugin to solve the problem, but this soon evolved into a general purpose head manager - head referring to a special section of an HTML document that provides the meta-data to describe style-sheets, keywords, and an assortment of other goodies.
Reasons for using the plugin
At its most basic, the plugin allows you to add any HTML head elements to:
- Individual posts
- Posts written by a specific users
- Posts belonging to certain categories
Why would you want to do any of that? Well, there are many reasons. The most simple is that you might want posts from different categories to appear with different styles, or maybe a post written by the administrator is in one style while posts from normal users get another.
Installation
The plugin should support the One-click format of the WP-Plugin-Mgr plugin. If installing manually then:
- Copy headspace.php to your
wp-content/pluginsdirectory - Activate plugin
You can find full details of installing a plugin on the plugin installation page.
Requirements:
There must be a call to wp_head () somewhere in your theme's header.php code. This is included in the default and classic themes provided with WordPress, and is likely to also occur in most themes you download. If the plugin does not work then check this first.
Using the plugin
Once the plugin is activated it is configured on a post-by-post basis by adding any of the following custom field data:
head_title |
Inserts an HTML title. Note that you are allowed one title per page, and your current theme probably provides it already. |
head_keywords |
Add meta keywords, to be picked up by search engines. Keywords are separated with commas:
|
head_description |
Add a meta description, sometimes used by search engines. |
head_style |
Add a style-sheet. The format of this is:
|
head_meta |
Add any generic meta data. The format of this is:
|
head_raw |
Add raw data. This data will simply be inserted into the head - use at your own peril! |
Wildcards
The plugin makes use of special 'wildcards'. These are tags that are replaced with dynamic data taken from the current post:
%%nickname%%- insert the nickname of the author%%useremail%%- insert the email of the author%%userid%%- insert the user ID of the author%%categoryNid%%- insert the Nth category ID of the post (start at 1)%%categoryNdesc%%- insert the Nth category description of the post (start at 1)%%categoryNname%%- insert the Nth category name of the post (start at 1)%%title%%- insert the title of the post%%date%%- insert the date the post was created%%modifed%%- insert the date the post was modified%%excerpt%%- insert the post excerpt%%id%%- insert the post's database ID%%gid%%- insert the relative URL to the post
Any number of wildcards can exist within a single keyword.
Examples
Add an extra style-sheet
head_style = link /wp-content/styles/example/extrastyle.css
Add a style-sheet that changes depending on who authored the post
head_style = link /wp-content/styles/users/%%nickname%%/extrastyle.css
Add keywords to the post
head_keywords = eggs,sandwiches,%%title%%
Add a description to the post
head_description = %%excerpt%%
Adding custom data
To add custom data to posts, and so get the plugin to work, you need to:
- Enable 'Advanced Editing'
-
- Either press the 'Advanced Editing' button on the post
- Or enable Advanced Editing by default in the Options / Writing section of the administration screen
- Add a new custom field with a keyword being one of the above, and the value being your chosen value
The keywords should not be entered into the post itself.
Global meta data
A new feature is the ability to have a list of globally applied meta-data. That is, meta-data that is applied to every post regardless of whether it is defined in the post custom data. This would be useful to define site-wide styles and descriptions.
The global meta-data is a text file located at wp-content/plugins/headspace_global.txt. It is a simple list of keyword and value, one per line separated with a return. All keywords and data follow the same syntax and rules as described above:
head_title This post was updated at %%modified%% head_description %%excerpt%% head_style /wp-content/styles/%%nickname%%/style.css
See also
Post-plugin research shows that Dougal Campbell wrote the plugin HeadMeta, which does a similar job to this one. The moral of the story: research before writing!






Comments (page 5 of 6)
Jul 1, 2008 1:44 am
Hi John, thanks for a great plugin.
I took the HeadSpace2 zip file, unzipped it, and put it in my WP plugins directory. I activated it in WP and then went to Settings -> Plugins. I am looking under "Page Settings" and click around Global Settings, Home Page, etc. but the clicking doesn't take me anywhere.
Then, I click on Modules, Options, and Import and get a 404. I doublechecked that I am extracting the files correctly, etc. Have you heard of this happening before?
Thanks.
May 9, 2008 2:31 pm
Matt, you need to modify header.php in your theme.
Apr 12, 2008 6:56 pm
How do I remove the "ยป" or » from the titles output by HeadSpace?
Apr 5, 2008 6:50 am
Kevin, HeadSpace is no longer supported. HeadSpace2 (which works in WP 2.0-2.5) is over on the HeadSpace2 plugin page.
Apr 3, 2008 9:02 pm
Any expectations for getting this to work with Wordpress 2.5? The auto-tagging seems to be busted by the new upgrade.
Mar 5, 2008 10:40 am
Right, that's understandable. I've created a feature request for this, and it will probably get folded into the plugin in the future.
Mar 5, 2008 9:42 am
If I use 50 tags in a post then having those 50 words/phrases in the head section just makes for clutter and is almost 100% useless in terms of seo. I just don't like clutter and fluff. It might be nice to be able to limit the number of words that appear in the meta keywords, or just to not use them at all. Really what I'd like to do is just use the post title in the keywords.
Mar 5, 2008 7:56 am
David, currently there is no option to disable tags from appearing in meta keywords. Can I ask why you want to do this?
Mar 4, 2008 2:52 am
On posts I'm trying to stop the tags from showing up in the meta keywords, but no matter what I put in the Tags/keywords section of the Posts & Pages settings the tags keep showing.
Jan 25, 2008 9:38 am
Really great, also for Search Engine Optimizer like me
thanks a lot.
Leave a comment