When your website means business.

Snippets

A collection of (mostly) WordPress-related snippets and references I’ve found useful and worth keeping where I can find them. Feel free to use what you like, and point me to some better snippets or references.

Add search form to specific nav menu»

add_filter('wp_nav_menu_items', 'add_search_form', 10, 2); function add_search_form($items, $args) { if( $args->theme_location == 'MENU-NAME' ) $items .= '<li class="search"><form role="search" method="get" id="searchform" action="'.home_url( '/' ).'"><input type="text" value="search" name="s" id="s" /><input type="submit" id="searchsubmit"…
Nav Menu, Search | Type: PHP

Add Theme Support for Title Tag»

It used to be that the way to add the Title Tag to WP sites was to add this in the theme’s header.php: <title><?php wp_title(); ?></title> Since WP4.1, use this…
Template Tags, WP/CP | Type: PHP

Menu
We use cookies in order to give you the best possible experience on our website. By continuing to use this site, you agree to our use of cookies.
Accept
Cookies Notice