Category Archives: WordPress
Jul 19, 2010 by Matt | Posted in WordPress
One thing that plugin developers want to do sooner or later is create a “fake” post. (Maybe you have a statistics plugin that you want to display a public graph when someone visits example.org/traffic
.) You need to create the equivalent of a Page on the fly.
Fortunately, someone has already figured out how to do just that.
The general idea is to
- Collect the page slug from the request
- See if it matches the URL we want our virtual Page to be located at
- Prepare the content and metadata for the fake Page
- Hijack the page retrieval by changing the values of some variables
- Display everything as usual
It seems to work pretty well, and nothing seems to break when running a plugin making use of the trick.
Jul 16
Do you frequently log-in to your WordPress install over public WiFi networks? While it may seem like paranoia to some people, it’s really not a good idea to log into important sites over an unencrypted connection. There’s always a possibility that someone could be…
Jun 30
A lot of people enjoy using the easy to use Tumblr service as a way to save and share links, quotes, videos, pictures, etc.. These “tumbleblogs,” as they are called, are a neat idea. It’s a similar concept to Twitter, posting quick updates instead…
Jun 28
You may have noticed that a lot of large blogs, like Smashing Magazine and the TUTS+ network, are “lazy-loading” images in their posts. Sometimes, as you scroll through a post full of images, you might catch an image fading in just as it comes…
Jun 18
Just yesterday WordPress 3.0 was finally made available. Featuring the new default “Twenty Ten” theme and the long-awaited (by some) merging of WordPress and WordPress MU. The interface, also, has had some cosmetic changes. Everything is still in the same place, but it’s all…
Jun 11
WordPress provides an RSS feed for just about every part of the website. You can get XML output for anything, from posts to tags to comments. But what if you’re working with JavaScript? Wouldn’t it be nice to have a JSON option? That’s what…
Jun 2
When working on a plugin or theme, have you ever went to your browser to test some changes, only to be greeted by the dreaded blank white screen? Sometimes the bug in your code is immediately apparent, but what about the times when it’s…
May 21
I generally prefer to write my posts with WordPress’s visual editor, as it gives me a better idea of what the post will look like as I write it than the HTML view does. But it still looks different than the final post will…
May 11
You may have noticed that, a few weeks ago, I added a new field to the comment form here on Webmaster-Source. A new “Twitter ID” field lets you input your Twitter username so it can be displayed next to the name you enter, complete…
May 6
On May 10th, Michael Martin, the blogger and designer behind Pro Blog Design, will launch his latest business venture: PliablePress. PliablePress is going to be a purveyor of quality WordPress themes, particularly ones that “aren’t simple little themes that you can turn out in…
Integrate Twitter @Anywhere into Your WordPress Comments
May 11You may have noticed that, a few weeks ago, I added a new field to the comment form here on Webmaster-Source. A new “Twitter ID” field lets you input your Twitter username so it can be displayed next to the name you enter, complete…