BuilderChild-Acute

(Difference between revisions)
Jump to: navigation, search
(Added = How to style navigation menu in non Header module =)
 
(How to set default text in search field)
Line 9: Line 9:
 
Note: In the CSS code, "1" in ".builder-module-1" must be changed to match the position of module from the top.
 
Note: In the CSS code, "1" in ".builder-module-1" must be changed to match the position of module from the top.
  
= Item 2 =
+
= How to set default text in search field =
 +
 
 +
[[File:Acute-search-text.png]]
 +
 
 +
Create a file named searchform.php in the child theme directory having this code:
 +
 
 +
<pre class="brush:php;">
 +
<?php $search_box_default = __( 'Search site', 'it-l10n-BuilderChild-Acute-Blue' ); ?>
 +
<?php $search_box_value = esc_attr( apply_filters( 'the_search_query', get_search_query() ) ); ?>
 +
<?php $search_box_value = ( empty( $search_box_value ) ) ? $search_box_default : $search_box_value; ?>
 +
<form role="search" method="get" id="searchform" action="<?php echo get_option( 'home' ); ?>/">
 +
<div>
 +
<input type="text" value="<?php echo $search_box_value; ?>" name="s" id="s" onfocus="if(this.value == '<?php echo $search_box_default; ?>') this.value = '';" onblur="if(this.value == '') this.value = '<?php echo $search_box_default; ?>';" />
 +
<input type="submit" id="searchsubmit" value="<?php echo esc_attr__( 'Search', 'it-l10n-BuilderChild-Acute-Blue' ); ?>" />
 +
</div>
 +
</form>
 +
</pre>
 +
 
 +
In the above, change
 +
 
 +
# ''Search site'' to the text that you would like to appear by default in the search box.
 +
# ''it-l10n-BuilderChild-Acute-Blue'' to indicate the particular color variation of Acute. This is only for translation purpose.
  
 
= Item 3 =
 
= Item 3 =
  
 
= Item 4 =
 
= Item 4 =

Revision as of 03:12, October 11, 2011

Demo Site

Contents

How to style navigation menu in non Header module

When a Custom Menu widget is used in Header module, it gets styled automatically as can be seen in the demo site.

To get the same styling working in a non Header module, like say, a widget bar module, add this CSS code at end of your child theme's style.css.

Note: In the CSS code, "1" in ".builder-module-1" must be changed to match the position of module from the top.

How to set default text in search field

Acute-search-text.png

Create a file named searchform.php in the child theme directory having this code:

<?php $search_box_default = __( 'Search site', 'it-l10n-BuilderChild-Acute-Blue' ); ?>
<?php $search_box_value = esc_attr( apply_filters( 'the_search_query', get_search_query() ) ); ?>
<?php $search_box_value = ( empty( $search_box_value ) ) ? $search_box_default : $search_box_value; ?>
<form role="search" method="get" id="searchform" action="<?php echo get_option( 'home' ); ?>/">
	<div>
		<input type="text" value="<?php echo $search_box_value; ?>" name="s" id="s" onfocus="if(this.value == '<?php echo $search_box_default; ?>') this.value = '';" onblur="if(this.value == '') this.value = '<?php echo $search_box_default; ?>';" />
		<input type="submit" id="searchsubmit" value="<?php echo esc_attr__( 'Search', 'it-l10n-BuilderChild-Acute-Blue' ); ?>" />
	</div>
</form>

In the above, change

  1. Search site to the text that you would like to appear by default in the search box.
  2. it-l10n-BuilderChild-Acute-Blue to indicate the particular color variation of Acute. This is only for translation purpose.

Item 3

Item 4

Personal tools
Namespaces
Variants
Actions
iThemes Codex
Codex Navigation
Toolbox