Tag Archives: PHP

WordPress and Pow

Apple + WordPress = POW!

Here is my second take on running WordPress and WordPress Multisite locally on my Mac (first is here). I just discovered Pow; “Pow is a zero-config Rack server for Mac OS X. Have it serving your apps locally in under a minute”, and my first thought was “can I run WordPress on Pow?”.  Well, here’s how I did it (I’ll also show you how to install MySQL, PHP 5.4 and Ruby 1.93 on Mac OS X Mountain Lion):

View the step by step installation guide

WordPress plugin template

UPDATE: As of WordPress 3.3, you shouldn’t use the wp_print_styles hook, I’ve updated the Adding JavaScript section below to reflect this change.

You can create a personalized plugin template by using my WordPress Plugin Template Creator

When I  rewrote my WP-DenyHost plugin, I wanted to do it as fast as possible. Instead of reinventing the wheel (again), I googled after a plugin template and found a very good one at Pressography. It had most of what I needed in a plugin template.

Continue reading

jQuery 101: Adding unobtrusive ajax to your existing form page

Using jQuery and the form and validate plugins, it is simple to add  unobtrusive ajax to your existing form page

1, Modify your existing form page

  1. Add <input type="hidden" name="isAjax" id="isAjax" value="0" /> to your form. This field will tell the processing script, process_input.php in my example, if the values in the form were submitted using ajax or as an ordinary form submit, defaulting to isAjax = 0 (false).
  2. Add class="required" to the fields that requires input
  3. Add the <div id="result"></div> where you want the ajax output

[sourcecode language=”html”]
<form id="form1" name="form1" method="post" action="process_input.php">
<input type="hidden" name="isAjax" id="isAjax" value="0" />
Name: <input type="text" name="name" class="required" id="name" value="" /> <br />
<input type="submit" name="submit" id="submit" value="submit" />
<div id="result"></div>
Continue reading