PHP
  Home arrow PHP arrow Customizing WordPress Search Results to Sort by Title
Dev Shed Forums  
Administration  
AJAX  
Apache  
BrainDump  
DHTML  
Flash  
Java  
JavaScript  
Multimedia  
MySQL  
Oracle  
Perl  
PHP  
Practices  
Python  
Reviews  
Security  
Smartphone Development  
Style-Sheets  
Web Services  
XML  
Zend  
Zope  
Mobile Linux  
App Generation ROI  
IBM® developerWorks  
Forums Sitemap  
E-Commerce Hosting  
Linux Web Hosting  
Managed Hosting  
Small Business Hosting  
VPS Hosting  
Weekly Newsletter

 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid  
Request Media Kit
Contact Us  
Site Map  
Privacy Policy  
Support  
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
PHP

Customizing WordPress Search Results to Sort by Title
By: Codex-M
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: starstarstarstarstar / 3
    2009-05-05


    Table of Contents:
  • Customizing WordPress Search Results to Sort by Title
  • The WordPress Search Results Function
  • Use WordPress Query.php for customized search results
  • Sort Search Results by Title Plug-in
  • Designing a Complex Application

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      error-file:tidyout.log Del.ici.ous error-file:tidyout.log Digg
      error-file:tidyout.log Blink error-file:tidyout.log Simpy
      error-file:tidyout.log Google error-file:tidyout.log Spurl
      error-file:tidyout.log Y! MyWeb error-file:tidyout.log Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article

     
     
    ADVERTISEMENT


    Customizing WordPress Search Results to Sort by Title
    ( Page 1 of 5 )

    Sorting search results by post title in WordPress is often useful, if your website needs its entries to be sorted alphabetically. As a quick background, WordPress is the most popular open source, free blogging/CMS platform. However, the default search results are sorted by date, so there is no easy way to sort them alphabetically except to edit the core WordPress search functionally source code.

    There are a number of applications for which it would be useful to sort post titles alphabetically. For example, say you use WordPress for a social networking site. With that kind of site, people stop by and register their names. As a result, users need to be able to search for names in the WordPress search box. So the search results need to be sorted alphabetically so that visitors can easily find people's names.

    There are countless applications for the ability to sort post titles alphabetically in WordPress. Here's another example: say you use WordPress on an online bookstore. Again, you'll need to alphabetize search results, by book titles and/or author names. As of February 2009, surprisingly enough, no WordPress plug-in has been developed to provide this feature.

    In fact, one of the best ways to apply this feature is to work with the “Search Everything” plug-in. You can read more about this in: http://wordpress.org/extend/plugins/search-everything/ . A detailed discussion of this plug-in is beyond the scope of this article; however, sample applications are illustrated in the last section of this tutorial.

    It is the objective of this article to explain how to sort WordPress search results by post title.

    Basic Requirements and Enabling WordPress Search Widget

    This tutorial has been tested to work in WordPress version 2.5.1 to 2.6.1. To tweak the WordPress search function appropriately, you need to have the following:  

    • Full FTP access to your WordPress site.
    • A newer version of WordPress, specifically 2.5.1 to 2.7 (older versions of WordPress have not been tested for this application, and it is recommended that you upgrade for security reasons).

    The tweak will not work if you do not have full FTP access and the appropriate version of WordPress. You may need to coordinate with your web agency or any person that has full access to the website server files.

    If you have all of the requirements, the next thing you need to do is enable the WordPress Search Widget. The steps below have been tested to work in WordPress version 2.5.1 to 2.6.1.

    1. Go to Dashboard

    2. Go to Design

    3. In the list of sub-menus, namely Themes, Widgets and Theme Editor, click “Widgets”

    4. In the first column, you will see “Available Widgets.” Find “Search” and then click “Add.” This will add a search form to your website.

    After completing these steps, the search widget will now be shown in the “current widgets” column. Check the screen shot below for an example:



     
     
    >>> More PHP Articles          >>> More By Codex-M
     

       

    PHP ARTICLES

    - Building Dynamic Queries with Chainable Meth...
    - PHP Encryption and Decryption Methods
    - Building a MySQL Abstraction Class with Meth...
    - Completing a Sample String Processor with Me...
    - Mastering WHILE Loops for PHP and MySQL
    - Method Chaining: Adding More Methods to the ...
    - Method Chaining in PHP 5
    - The Role of Interfaces in Applying the Depen...
    - Dependency Injection: Using a Setter Method ...
    - Using a Model Class with the Dependency Inje...
    - Injecting Objects Using Setter Methods with ...
    - Injecting Objects by Constructor with the De...
    - The Dependency Injection Design Pattern in P...
    - Performing Inferential Statistical Analysis ...
    - Performing Descriptive Statistical Analysis ...





    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 1 Hosted by Hostway
    Stay green...Green IT