Twitter
It's March the 9th and it's snowing... 2 days ago
August, 05 2009

Add a category filter to WordPress search form

WordPress has a simple function to build a search form for your blog and in this tutorial I’ll show you how to add a category filter to it.

< ?php get_search_form(); ?>

This function will look for a file called searchform.php inside your template folder: if it doesn’t exist it will output the standard search form. So, if it isn’t already in place, create your custom searchform.php and copy into it the default search form output. It should look similar to this:

<form role="search" method="get" id="searchform" action="<?php bloginfo('siteurl'); ?>">
  <div>
    <label class="screen-reader-text" for="s">Search for:</label>
    <input type="text" value="" name="s" id="s" />
    <input type="submit" id="searchsubmit" value="Search" />
  </div>
</form>

Read the rest of this entry »

May, 28 2009

Setup a LAMP server on Ubuntu

These are the steps to install an Apache-MySQL-PHP server on an Ubuntu desktop machine.

# Install Apache 2
sudo apt-get install apache2
 
#Install PHP5
sudo apt-get install php5
 
#Install MySQL
sudo apt-get install mysql-server
 
#Install MySQL for Apache
sudo apt-get install libapache2-mod-auth-mysql
 
#Install PHP MySQL Support
sudo apt-get install libapache2-mod-php5
sudo apt-get install php5-mysql
 
#Restart Apache
sudo /etc/init.d/apache2 restart

Managing Apache

Web files must be placed in ”/var/www/”.

sudo /etc/init.d/apache2 start
sudo /etc/init.d/apache2 stop
sudo /etc/init.d/apache2 restart

Managing MySql

sudo /etc/init.d/mysqld start
sudo /etc/init.d/mysqld stop
sudo /etc/init.d/mysqld restart