search

Drupal 7: How to add a custom CSS class to the last search result item on the search page

  • Posted on: 14 November 2012
  • By: shivanj

This is a small tidbit of information in the event that you wanted to alter the Drupal search results page. You can add a custom CSS class to the last search result item (for whatever reason you may have). In my case, I wanted to remove the border-bottom from the last result, so I had to add a special CSS class to do this.

Just follow these simple steps:

  1. Override template_preprocess_search_results