Blurp as Search Box

resolved (28 posts) (3 voices)

  1. geekgurl00
    Member

    Id like to use the blurp area of the theme as a search box rather than having it in the sidebar. How do I go about doing that?

    Posted 1 year ago #
  2. Elliott
    Support

    Hello geekgurl00,

    You want it somewhere around here? (see attached image)

    Attachments

    1. 1.jpg (8.2 KB, 0 downloads) 1 year old
    Posted 1 year ago #
  3. geekgurl00
    Member

    Yes that would be great. And I dont want the text box/button either...just the search field.

    Posted 1 year ago #
  4. Elliott
    Support

    Open up /wp-content/themes/infocus/includes/template-single.php and add the following code on line 155.

    <div class="widget scg_widget KerioConnect widget_search" id="search-4"><div style="position: absolute; top: 55px; right: 0px;" class="search-box">
    <form action="http://www.mysite.com/" method="get">
    <input type="text" onblur="if (this.value == '') {this.value = 'Search...';}" onfocus="if(this.value == 'Search...') {this.value = '';}" value="Search..." id="s" name="s" class="search-field" size="15">
    </form>
    </div>
    </div>

    This will insert a search box on your single posts. To get them on your pages also then you will need to do the same thing to page.php and template-full.php.

    Let us know if this works for you geekgurl00.

    Posted 1 year ago #
  5. HouseofStrauss
    Member

    In case anyone is interested, this code snippet will also put the search in the header if you insert it after line 92 in header.php ( see my screenshots)

    Attachments

    1. capture076.jpg (85.8 KB, 7 downloads) 1 year old
    2. capture077.jpg (20.3 KB, 4 downloads) 1 year old
    Posted 1 year ago #
  6. geekgurl00
    Member

    I dont have a file called template-single.php in my directory and my full-template only goes to line 99. I tried pasting in the code where I think it should go, but I still get the title and a phrase saying: "A state permitting clear perception and understanding; the area that may be seen distinctly or resolved into a clear image. " And Im not sure how to get rid of that.
    Thanks!
    Kristin

    Posted 1 year ago #
  7. Elliott
    Support

    Hey Kristin,

    In each of the files listed you should see some code like this..

    <?php
    //Header Teaser Text Options
    if (!$teaser_text || $teaser_text == 'default') {
    
    	if ($header_teaser == 'customtext' && $teaser_custom) {
    		echo stripslashes($teaser_custom);
    	}
    	if ($header_teaser == 'twitter' && !$twitter_id) {
    		echo 'You must have your Twitter user name entered in the "General Settings" tab of your themes options for this to function properly.';
    	}
    	if ($header_teaser == 'twitter' && $twitter_id) {
    		$usernames = $twitter_id; $limit = '1'; $type = 'teaser';
    		parse_cache_feed($usernames, $limit, $type);
    	}
    
    }else{
    
    	if ($teaser_text == 'custom' && !$teaser_text_custom) {
    		echo stripslashes($teaser_custom);
    	}
    	if ($teaser_text == 'custom' && $teaser_text_custom) {
    		echo stripslashes($teaser_text_custom);
    	}
    	if ($teaser_text == 'twitter' && !$twitter_id) {
    		echo 'You must have your Twitter user name entered in the "General Settings" tab of your themes options for this to function properly.';
    	}
    	if ($teaser_text == 'twitter' && $twitter_id) {
    		$usernames = $twitter_id; $limit = '1'; $type = 'teaser';
    		parse_cache_feed($usernames, $limit, $type);
    	}
    }
    ?>

    You will want to paste the code immediately after this. Sorry, I gave you the wrong directory in the last post. To find template-single.php first look in your template directory and open the folder lib and then open the folder includes and you should see the file there.

    If you are having trouble then let us know and we will make the changes for you.

    Posted 1 year ago #
  8. geekgurl00
    Member

    Ive pasted the code into the template, but it is still not working. Ive attached a pic of what is happening. Ive also set the Header Teaser Text to Custom on the main options page of the theme.

    Attachments

    1. search_box.jpg (57.4 KB, 0 downloads) 1 year old
    Posted 1 year ago #
  9. Elliott
    Support

    Hello geekgurl00,

    Let's try this.. Download the attached file and extract it to /wp-content/themes/infocus/lib/includes/

    View one of your posts and let me know if you see a search bar.

    Posted 1 year ago #
  10. Elliott
    Support

    Hello geekgurl00,

    Let's try this.. Download the attached file and extract it to /wp-content/themes/infocus/lib/includes/

    View one of your posts and let me know if you see a search bar.

    Attachments

    1. template-single.zip (3 KB, 2 downloads) 1 year old
    Posted 1 year ago #
  11. geekgurl00
    Member

    That worked! Is there a way to have the same effect on my pages too and not just the posts?

    Thanks for all the help!

    Posted 1 year ago #
  12. Elliott
    Support

    Yes we can do this for pages as well.. I am kind of busy right now geekgurl00 (computer problems) but I should get back with you tonight with the fixes.

    Posted 1 year ago #
  13. geekgurl00
    Member

    No problem. Im just glad for the help!

    Posted 1 year ago #
  14. Elliott
    Support

    Download and extract this file to /wp-content/themes/infocus/ for pages. It will not show up on the portfolio / blog page. If you want those too let me know.

    Posted 1 year ago #
  15. Elliott
    Support

    Download and extract this file to /wp-content/themes/infocus/ for pages. It will not show up on the portfolio / blog page. If you want those too let me know.

    Attachments

    1. page.zip (1.2 KB, 1 downloads) 1 year old
    Posted 1 year ago #
  16. geekgurl00
    Member

    Ive copied the file over and set the Header teaser text to custom under general settings and it's still not showing up. Do I need to do anything else to make it work?

    Attachments

    1. search_box.jpg (60 KB, 0 downloads) 1 year old
    Posted 1 year ago #
  17. Elliott
    Support

    Hello geekgurl00,

    Is it a full width or default page?

    Posted 1 year ago #
  18. geekgurl00
    Member

    Its the full width page.

    Posted 1 year ago #
  19. geekgurl00
    Member

    I got it to work with full template. Thanks again for all your help!
    Kristin

    Posted 1 year ago #
  20. Elliott
    Support

    Open up /wp-content/themes/infocus/template-full.php and at the top you should see some code like this..

    <div id="intro_blurb"<?php if ($header_disable){echo ' style="display:none;"';}?>>
    	<div class="inner">
    		<div id="intro_blurb_title"><span><?php the_title(); ?></span></div>
    			<div id="blurb">
    
    			<?php
    			//Header Teaser Text Options
    			if (!$teaser_text || $teaser_text == 'default') {
    
    				if ($header_teaser == 'customtext' && $teaser_custom) {
    					echo stripslashes($teaser_custom);
    				}
    				if ($header_teaser == 'twitter' && !$twitter_id) {
    					echo 'You must have your Twitter user name entered in the "General Settings" tab of your themes options for this to function properly.';
    				}
    				if ($header_teaser == 'twitter' && $twitter_id) {
    					$usernames = $twitter_id; $limit = '1'; $type = 'teaser';
    					parse_cache_feed($usernames, $limit, $type);
    				}
    
    			}else{
    
    				if ($teaser_text == 'custom' && !$teaser_text_custom) {
    					echo stripslashes($teaser_custom);
    				}
    				if ($teaser_text == 'custom' && $teaser_text_custom) {
    					echo stripslashes($teaser_text_custom);
    				}
    				if ($teaser_text == 'twitter' && !$twitter_id) {
    					echo 'You must have your Twitter user name entered in the "General Settings" tab of your themes options for this to function properly.';
    				}
    				if ($teaser_text == 'twitter' && $twitter_id) {
    					$usernames = $twitter_id; $limit = '1'; $type = 'teaser';
    					parse_cache_feed($usernames, $limit, $type);
    				}
    			}
    			?>
    		</div>
    	</div><!-- inner -->
    </div><!-- intro_blurb -->

    To get the search bar to show then you just paste this code..

    <div class="widget scg_widget KerioConnect widget_search" id="search-4"><div style="position: absolute; top: 55px; right: 0px;" class="search-box">
    <form action="http://www.mysite.com/" method="get">
    <input type="text" onblur="if (this.value == '') {this.value = 'Search...';}" onfocus="if(this.value == 'Search...') {this.value = '';}" value="Search..." id="s" name="s" class="search-field" size="15">
    </form>
    </div>
    </div>

    at the end before the ending </div> tags like this..

    <div class="widget scg_widget KerioConnect widget_search" id="search-4"><div style="position: absolute; top: 55px; right: 0px;" class="search-box">
    			<form action="http://www.mysite.com/" method="get">
    			<input type="text" onblur="if (this.value == '') {this.value = 'Search...';}" onfocus="if(this.value == 'Search...') {this.value = '';}" value="Search..." id="s" name="s" class="search-field" size="15">
    			</form>
    			</div>
    			</div>
    
    		</div>
    	</div><!-- inner -->
    </div><!-- intro_blurb -->

    If you are confused then open up the file I gave you.. page.php and you can see how it is done. Just do the same thing to all pages where you want the search bar to display.

    Posted 1 year ago #
  21. geekgurl00
    Member

    Ive got the search bar to show, but Im trying to remove the title tag. Ive taken out the <php title> tags, but Im still left with this blue bar. How do I remove that?
    Thanks!
    Kristin

    Attachments

    1. title_bar.jpg (22.7 KB, 1 downloads) 1 year old
    Posted 1 year ago #
  22. Elliott
    Support

    For that you will need to comment out the entire line like this..

    <!--<div id="intro_blurb_title"><span><?php //the_title(); ?></span></div>-->

    If you do it on template-full then it will apply to all full width pages if you do it to page.php then it will apply to all default pages, etc etc.

    Posted 1 year ago #
  23. geekgurl00
    Member

    When I do that it takes away the entire search box.

    Attachments

    1. no_searchbox.jpg (12.8 KB, 0 downloads) 1 year old
    Posted 1 year ago #
  24. Elliott
    Support

    Hey Kristin,

    Download the attached file and extract to /wp-content/themes/infocus/

    Let us know if it works.

    Attachments

    1. template-full.zip (1.2 KB, 3 downloads) 1 year old
    Posted 1 year ago #
  25. geekgurl00
    Member

    I copied it over and reset the URL to localhost/wordpress and it is still not working. It is just a empty box like before.
    Thanks!
    Kristin

    Posted 1 year ago #
  26. Elliott
    Support

    Hello geekgurl00,

    If that file did not work then you are most likely not using the full width template or you have some other customizations going on.

    Give me a link to your page where it is not working. If that is not possible then I recommend downloading a fresh version of inFocus so it will work for you.

    Posted 1 year ago #
  27. geekgurl00
    Member

    Im running the file off a pen drive since its my test site. Ill try the fresh install and report back.
    Thanks!

    Posted 1 year ago #
  28. geekgurl00
    Member

    That did work. Now how do I go about doing the same on the default template?
    Thanks for all your help!
    Kristin

    Posted 1 year ago #
  29. Elliott
    Support

    Hey Kristin,

    Download the attached file and extract to /wp-content/themes/infocus/

    Let us know if it works.

    Attachments

    1. page.zip (1.2 KB, 3 downloads) 1 year old
    Posted 1 year ago #
  30. geekgurl00
    Member

    That worked too. Thanks again for all your help!
    Kristin

    Posted 1 year ago #

Reply

You must log in to post.

Myriad WordPress Theme
Myriad wordpress theme
Method WordPress Theme
Method wordpress theme
Fusion WordPress Theme
Fusion wordpress theme
Elegance WordPress Theme
Elegance wordpress theme
Echelon WordPress Theme
Echelon wordpress theme
Dejavu WordPress Theme
Dejavu wordpress theme
Modular WordPress Theme
Modular wordpress theme