Sliding Headers and Search Toggle
-
Hi, nobita,
Thank you very much for your patient and knowledgeable help, making my web design better and better.
If possible, could you spare me another 2 recipes for (i) Making the Header with 3 or 4 sliding header photos with a > or < for advancing or backing, showing seasonal changes, for example, thus adding more intrigues to a webpage, and (ii) adding a Search Toggle (like O-)to the end of the Navigation Menu Bar?
Thank you again,
Ken
-
Toggle Search at primary menubar
add to functions.php first line (
<?phpbefore )<?php add_filter( 'raindrops_nav_menu_primary_html', 'my_add_search_form' ); function my_add_search_form( $content ) { $search_form = get_search_form(false); return preg_replace( '!(</nav>)!',"<div class=\"primary-menu-search\">{$search_form}</div>$1",$content ); } ?>Add to style.css
/*:::: Toggle Search Form at nav menu primary :::::*/ .primary-menu-search{ height:3em; } .primary-menu-search input[type="search"] { -webkit-appearance: textfield; padding-right: 2px; /* Don't cut off the webkit search cancel button */ width: 270px; } .primary-menu-search input[type="search"]::-webkit-search-decoration { -webkit-appearance: none; } .primary-menu-search button::-moz-focus-inner, .primary-menu-search input::-moz-focus-inner { border: 0; padding: 0; } .primary-menu-search .searchform #searchsubmit { display: none; } .primary-menu-search .searchform { float:right; position:relative; height:2em; top:-1em; } .primary-menu-search .searchform #s{ background-color: transparent; background-image: url( http://your site search png image 24px x 24px/ ); background-position: 0 center; background-repeat: no-repeat; background-size: 24px 24px; border: none; height:2em; cursor: pointer; margin: 3px 0; padding: 0 0 0 34px; position: relative; width: 0; } .primary-menu-search .searchform #s:focus{ cursor: text; outline: 0; width: 150px; max-width:100%; position:relative; height:2em; }Sliding Headers
For example
install pluginhttp://ww.wp.xz.cn/plugins/easing-slider/
Add to functions.php
<?php add_filter( 'raindrops_header_image_home_url' , 'my_slide_show' ); function my_slide_show( $header_image ) { if ( class_exists( "ESL_Slideshow" ) ) { if ( is_front_page() || is_home() ) { //if need slideshow shows only home. return ESL_Slideshow::get_instance()->display_slideshow(); } } return $header_image; } ?>Thank you.
Hi, Nobita,
After installing the Easy Slider Lite plug-in, I copied and pasted your php code, but resulted in Fatal Error as follows. I have no access to my website now. Plkease help thanks,
Fatal error: Cannot redeclare nobita_setup_theme() (previously declared in /home3/wccesq/public_html/wp-content/themes/raindrops-child/functions.php:50) in /home3/wccesq/public_html/wp-content/themes/raindrops-child/functions.php on line 165
Error reason
functions nobita_setup_theme declare two times.
line 50 and line 165
Please delete function either
Hi, nobita,
I was able to restore the Child Theme through my Web-Host. However, The Navigation Menu Bar occupies the entire page, different from before. Below is my child css, and my web is rowlandassociation.com. Please help; thanks,/* Theme Name: raindrops-child Version: 0.1 Description: A child theme of raindrops Template: raindrops */ #site-title{ background:url(http://www.rowlandassociation.com/wp-content/uploads/2014/03/Rowland-Association-Logo-1.png); width:478px;/* logo width */ height:56px;/* logo height */ } #site-title a{ display:block; width:100%; height:100%; } #site-title a span{ visibility:hidden!important; } .entry-title span{ color:#c00000 } #access a:hover { background:#3399FF !important; color:white; } #access .menu > ul > ul { top: 3.693em; } .entry-title{ display:none; } /* Change nav menu background and link color */ #top #access .menu li a, #top #access{ Background:#FF9933; color:#ffffff; } #top #access .menu .current_page_item a, #top #access .menu li a:hover{ background:#c00000; color:#ffffff; font-weight: bold; } #top #access .menu ul li .current-menu-item a { background: #c00000 !important; }Hi, nobita,
I reteted and discover the problem came from adding:
<p id="page-top" style="position:fixed;right:3px;bottom:0"><a href="#"><img src="http://tenman.info/labo/snip/wp-content/themes/raindrops/images/previous.png" style="-webkit-transform:rotate( 90deg );-moz-transform:rotate( 90deg );-ms-transform:rotate( 90deg );transform:rotate( 90deg );" alt="page top link" /></a></p>to the first line of Parent php Theme Function. Any solution?
Thanks,
Ken
Hi, nobita,
After removing the php-add-on to the Parent, Menu is back to normal, but missing the scroll to top feature.
Please advise. thanks,
Ken
Hi, nobita,
Please disregard all prior emails about recent problems; I have managed to restore to the good state right before corruptions.
I need to be more careful, when testing the new 2 receipes for Search and Sliding Headers.
Many THANKS, AND SORRY,
KenHi, nobita,
I am back with renewed courage.
For the Sliding Header, I installed the plugin. Do I add the php code to the parent or my child functions.php? If to the parent,then add to the first line of parent functions.php?
I want to be more careful before plunging in another adventure.
Please advise. Thanks,
Ken
I am new to the forums and I am currently using the Raindrops theme and something happened to my site. I am getting the following error when trying to view public site as well as login to the wordpress backend.
Parse error: syntax error, unexpected ‘?’ in /home3/projectx/public_html/wp-content/themes/raindrops/functions.php on line 1
my site is pinellasbusinessdirectory.com
at this point I have no access to my site so Im at a loss as to how to fix this. someone please help
Hi wccesq
Do I add the php code
Child themes functions.php
Thank you.
Worked. Thank you very much.
The topic ‘Sliding Headers and Search Toggle’ is closed to new replies.
