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 »
Tags: category, filter, functions, PHP, search, template, WordPress -
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
Tags: Apache, LAMP, Linux, MySQL, PHP, Ubuntu -