Brad Scott

Fiddling with WordPress

Migrating this site from some static HTML to WordPress has taken a couple of days. There were only a couple of issues that needed a bit of digging around:

1. I wanted to add a search box to the header, so followed the instructions about creating a search page, but though it mentioned the searchform.php, I didn’t have a template for that. This is the one that worked:

<form id="searchform" method="get" 
  action="<?php bloginfo('home'); ?>">
  <div class="search_form">
    <p><input class="search" type="text" name="s" id="s" 
     value="<?php the_search_query(); ?>"/>
     <input class="submit" type="submit" value="Search" />
    </p>
  </div>
</form>

2. The other thing was dynamic menu highlighting. Easy to do in static HTML, but I didn’t know how to in WordPress. Luckily the Codex tells all.

Leave a reply

Digital publishing consulting

With twenty years' experience in the information industry, and a broad range of activities in the digital/new media sector since 1994, Brambletye Publishing offer invaluable expertise for publishers and other information professionals. Read more