Skip to content
This repository has been archived by the owner. It is now read-only.

Commit

Permalink
Unique searchform id's & style enqueues
Browse files Browse the repository at this point in the history
reg-sidebars: replace searchform.php with searchform that increments
search widget id's
replace searchform.php with old-searchform.php so wp uses searchform
defined in reg-sidebars instead
functions: fix style enqueue
  • Loading branch information
szk11001 committed Jul 21, 2014
1 parent 96c500b commit 8d247a2
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 9 deletions.
11 changes: 2 additions & 9 deletions functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,16 +79,9 @@ function cs_widgets_init() {
/**
* Enqueue scripts and styles.
*/
function cs_scripts() {

// Without these random enqueue styles, the theme styles don't load for some reason. ????????????
wp_enqueue_style( 'xxxx',get_template_directory_uri() . '/aaaa.css' );
wp_enqueue_style( 'bbbb', get_stylesheet_uri(),array('xxxx') );

/*
function cs_scripts() {
wp_enqueue_style( 'cs-bootstrap-css',get_template_directory_uri() . '/bootstrap/css/bootstrap.min.css' );
wp_enqueue_style( 'cs-style', get_stylesheet_uri(),array('cs-bootstrap-css') );
*/
wp_enqueue_style( 'cs-style', get_stylesheet_uri(), array('cs-bootstrap-css') );

wp_enqueue_script( 'cs-bootstrap-js', get_template_directory_uri() . '/bootstrap/js/bootstrap.min.js', array( 'jquery' ));
wp_enqueue_script( 'cs-respond-js', get_template_directory_uri() . '/bootstrap/js/respond.js', array( 'jquery' ));
Expand Down
17 changes: 17 additions & 0 deletions inc/reg-sidebars.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,4 +81,21 @@ function mf_remove_extra( $sidebars_widgets ){
return $sidebars_widgets;
}
add_filter( 'sidebars_widgets', 'mf_remove_extra' );

function custom_searchform($form){
global $search_counter;
if( !$search_counter ){
$search_counter = 0;
}
$search_counter++;

$form = '<div class="searchform"><form action="/" method="get" class="form-inline" role="form"><div class="form-group"><fieldset>';
$form .= '<label for="search-'.$search_counter.'" class="sr-only">Search in '.home_url( '/' ).'></label>';
$form .= '<input type="text" name="s" id="search-'.$search_counter.'" value="'.the_search_query().'" class="form-control" placeholder="Search... " />';
$form .= '<button type="submit" class="btn btn-default" title="Search"><i class="glyphicon glyphicon-search"></i><span class="sr-only">Search</span></button>';
$form .= '</fieldset></div></form></div>';

return $form;
}
add_filter('get_search_form', 'custom_searchform');
?>
File renamed without changes.

0 comments on commit 8d247a2

Please sign in to comment.