October 2nd, 2007 | by Ben
I've recently created a WordPress plugin to list feeds by category that I thought I'd share with the world. Basically, rather than having only one feed url that shows all of your posts, this plugin allows people to subscribe to only the categories they want to receive updates from via RSS. The code is based off of old WordPress core code for list_cats function. You can see an example of it in the sidebar here: http://www.ben-huddleston.com/. More info after the jump.
Download the plugin |
Read the rest of this entry »
Posted in PHP, WordPress | No Comments » |
August 2nd, 2007 | by Ben
I’ve developed a WordPress Plugin that allows an author to insert ads within content of their posts. You could really use it to insert whatever code you wanted within your posts. NOTE: this is a beta plugin and I have not done extensive testing with it. Use at your own risk. Has been tested only on WordPress 2.2.1. It’s my first WordPress plugin so go easy on me. 
Read the rest of this entry »
Posted in PHP, WordPress | No Comments » |
April 5th, 2007 | by Ben
Here is some fairly simple code for restricting pages only to logged in users in WordPress. Just give me the code |
Read the rest of this entry »
Posted in PHP, WordPress | 47 Comments » |
April 5th, 2007 | by Ben
I combined three methods into one overall contact form. It uses an AJAX contact form if people have javascript enabled, and defaults back to the PHP form if they don’t. And it pre-validates the data to warn users about input that will get rejected by the contact form before they submit via javascript.
Note 1, READ THIS!!!!: uses a cookie for the AJAX form so the PHP form will load the first time you hit the page. Hit Reload on your browser to see the AJAX form. Read the full post for reasons why.
Note 2: I do some cursory validation with these scripts mainly to make sure that fields that should be text are text, fields that should be numbers are numbers, and email addresses are actually email addresses. You can easily add additional validation requirements by editing the files.
Note 3: The demo form will not send you the form information you fill out, so please don’t expect to receive anything when you submit it. Because people could use this to send other people unsolicited email by filling out someone else’s email in the form, I set it to send only to me. Sorry.
By all means, download the code and play around with it to see what it does. And please let me know if you find it useful or have questions by filling out the comment form for this post.
See it in action | Download the full code | Read the rest of this entry »
Posted in AJAX, PHP | 2 Comments » |
March 23rd, 2007 | by Ben
**NOTE**This site does not use this code so please don’t expect to see it in action here. If you would like to see an example, please visit http://www.jessicarstrickland.com/photographers/
The basic premise for this is that a client wanted the colors of the site to change at random when people visited her site but not change on every page load. Here’s how I accomplished this. I’m sure there may be better methods to accomplish it, but it worked for me and maybe it will come in handy for someone else.
Full Code Example | Download the Code | Read the rest of this entry »
Posted in PHP, WordPress | No Comments » |