Quick WordPress Hacks
Note: This post is over 2 years old. You may want to check later in this blog to see if there is new information.
The following links are auto-generated but may help you locate newer content:
Here are a couple tips that I’ve been using when I post with Wordpress. I’ve only been using Wordpress for a couple of months now, so this may be old news to some. I’ve turned off the Rich Text editor and am using the default editor with quicktags. By editing the quicktags.js file in the WP-admin directory, I’ve been able to add paragraph tags, edit the way ins and del tags handle time/datestamp in the titles, and add specific handlers for simpletags and code blocks. Read on for more details…
One of my favorite edits so far has been to add a title popup to the link tag. In the quicktags.js file change function edInsertLink() to read:
-
function edInsertLink(myField, i, defaultValue) {
-
if (!defaultValue) {
-
defaultValue = ‘http://’;
-
}
-
if (!edCheckOpenTags(i)) {
-
var URL = prompt(‘Enter the URL’ ,defaultValue);
-
if (URL) {
-
edButtons[i].tagStart = ‘<a href="’ + URL + ‘" title="’ + prompt(‘Enter a title for the link’, ”) + ‘">’;
-
edInsertTag(myField, i);
-
}
-
}
-
else {
-
edInsertTag(myField, i);
-
}
-
}
Another great edit is the Timestamp on ins and del tags. These show when you make edits to your posts, but provide no human readable timestamps. With this edit in your quicktags and a little tweak in your css, you can set these edits apart and put a title attribute on them with a human readable date/time stamp, customized to your liking/language. You can find info on this edit here.
I also changed line 242 of inline-uploading.php to read:
-
$script .= “aa[{$ID}] = ‘<a id="p{$ID}" rel="attachment" class="imagelink" href="$href" onclick="doPopup({$ID});return false;" title="{$title}">’;
This adds lightbox functionality to thumbnails linked to their full image automatically. I’m sure there are plugins to do this, but I include my prototype and effects files manually to avoid conflicts between plugins, so I run this manually.
All in all, I’ve played with Ecto and Performancing and several rich text editors, but I prefer the control of using the basic Wordpress editor with a few custom hacks. I hope this information is of use to somebody… I take no responsibility for any damage you cause once your text editor is open ;-).

Comments are closed
Comments are currently closed on this entry.