Per Søderlind

I code for fun

  1. PHP

Tag: PHP (Page 1 of 2)

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):

Read More

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.

Read More

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>

Read More

CSS Editor for WP and WPMU

Still work in progress, but here’s a teaser:

CSS Editor

Read More

toksta* chat plugin for BuddyPress

The toksta* chat plugin for BuddyPress makes it easy to add toksta* chat and webcam to your BuddyPress site.

Read More

Page 1 of 2

Powered by WordPress & Theme by Anders Norén