ThemeShaper Forums » Thematic

[closed]

Can't get search to appear next to menu. Please help

(8 posts)
  • Started 4 years ago by Loungefly
  • Latest reply from Karaviro
  • This topic is not resolved
  1. Loungefly
    Member

    Hi all,

    I'm trying to get my menu at the top of my page (above the header image) with a search box to the right of the menu and I'm not making any progress whatsoever. (I'm using thematic rev-709 btw if that has any relevance to problem)

    Just trying to get the search next to the navigation without moving access to the top is not working out for me at all.

    Here's a screenshot of my problem:

    http://img196.imageshack.us/img196/7862/problembc.jpg

    As you can see, the search bar ends up on the right on top of the side widget and now the default menu styling has disappeared. I tried adding the sf-menu styles over again to my child theme thinking that might help and it doesn't.

    I've followed the instructions to the letter several times at http://www.cozmoslabs.com/2009/04/15/add-a-search-box-to-the-thematic-menu/ and I've also checked out this thread: http://forums.themeshaper.com/topic/move-access-above-header-with-search-widget#post-14921

    Any help would be greatly appreciated. This is proving to be extremely frustrating :(

    Posted 4 years ago #
  2. hmm,
    I am using cosmolabs code and it works ok for me (another good link by the way is http://wptheming.com/2009/10/useful-thematic-filters/ )
    but from your image it could be your css... turn it off and check again.

    Posted 4 years ago #
  3. Loungefly
    Member

    Well, when I initially couldn't get it to work I figured it might have been the custom css I was using. So I started over with a blank child theme, with nothing in my child theme folder except a fresh functions.php and style.css file with only the code for this in them. The image I posted the link to is the default css (that the child theme is importing)with no added css by me. When I used the css and functions code at cosmolabs it just breaks the menu. :(

    Just out of curiosity, what version of thematic are you using? I'm wondering if that might have a bearing on my problem?

    Posted 4 years ago #
  4. I'm using 0.9.6.2 last official release in 22.02.2010 not following svn updates....that might be the problem i guess..
    but still try removing ALL your css the style.css links back to a whole set of the basic styles in other css files you might be importing them without knowing.

    Posted 4 years ago #
  5. Loungefly
    Member

    Okay, I setup a new thematic install with 0.9.6.2 just to be safe. Unless I'm misunderstanding you, you're saying to remove all the existing css imports that are present in the newly created child theme:

    @import url('../thematic/library/styles/reset.css');

    @import url('../thematic/library/styles/typography.css');

    @import url('../thematic/library/layouts/2c-r-fixed.css');

    @import url('../thematic/library/styles/images.css');

    @import url('../thematic/library/styles/default.css');

    @import url('../thematic/library/styles/plugins.css');

    If I remove those then I have no style at all. These were the only things I had in the child style.css before I added the cozmolab css and function.php info.

    I'll play around with it and hopefully something good will happen.

    Posted 4 years ago #
  6. Loungefly
    Member

    Okay, it's working now. :) I think me using the svn version might have had some bearing. I fiddled with the code in functions.php and all is good now.

    Just for reference, if anyone wants their menu at the top of the page with a search bar to the right of the menu, this is what must be in your functions.php:

    // Remove default Thematic actions
    function remove_thematic_actions() {
        remove_action('thematic_header','thematic_access',9);
    }
    add_action('init','remove_thematic_actions');
    
    // Create a custom access div with the menu and search box
    function search_access() { ?>
            <div id="access">
                <div class="skip-link"><a href="#content" title="<?php _e('Skip navigation to the content', 'thematic'); ?>"><?php _e('Skip to content', 'thematic'); ?></a></div>
                <?php wp_page_menu('sort_column=menu_order') ?>
    
                <div id="access-search">
                    <form id="searchform" method="get" action="<?php bloginfo('home') ?>">
                        <div>
                            <input id="s" name="s" type="text" value="<?php echo wp_specialchars(stripslashes($_GET['s']), true) ?>" size="20" tabindex="1" />
                            <input id="searchsubmit" name="searchsubmit" type="submit" value="<?php _e('Search', 'thematic') ?>" tabindex="2" />
                        </div>
                    </form>
                </div>
    
            </div><!-- #access -->
    <?php }
    add_action('thematic_aboveheader','search_access',9);

    And as mentioned in this thread - http://www.cozmoslabs.com/2009/04/15/add-a-search-box-to-the-thematic-menu/

    this is the css:

    #access-search{
    	position:absolute;
    	left:50%;
    	width:260px;
    	margin-left:170px;
    	height:29px;
    	border-top:1px solid #ccc;
    	border-left:1px solid #ccc;
    	border-right:1px solid #ccc;
    	padding:2px 0 0 4px;
    }

    Whew! What a relief. Thanks lewism for the feedback. :)

    Posted 4 years ago #
  7. thanks for sharing your solution!

    Posted 4 years ago #
  8. Hey i had the sam goal for my Webpage, just i wanted it without this "silly" button.
    I am new in php and a noob, but i played little bit with the code

    now it looks like how i'd like it, but when i come over the input box with the cursor, the textinput cursor doesn't fit with the box, i would like that the textinput cursor appears all over the inputbox.
    Any help?

    I'm using WP3.1 and thematic 0.9.7.8

    here's what i did:

    // Create a custom access div with the menu and search box
    function search_access() { ?>
            <div id="access" class="skip-link"><a href="#content">"><?php _e('Skip to content', 'thematic'); ?></a></div>
                <?php wp_page_menu('sort_column=menu_order') ?>
    					<form id="searchform" method="get" action="http://lebensgarten.ch/">
    						<div>
    							<input id="s" name="s" type="text" value="Suchen" onfocus="if (this.value == 'Suchen') {this.value = '';}" onblur="if (this.value == '') {this.value = 'Suchen';}" size="20" tabindex="1" />
    						</div>
    					</form>
            </div><!-- #access -->
    <?php }
    add_action('thematic_header','search_access',9);

    i didn't remove the default Thematic actions

    and here the style:

    #searchform{
        position:absolute;
        left:67%;
        padding:5px 0 0 0px
    }

    thanks peeps!

    Posted 3 years ago #

RSS feed for this topic

Topic Closed

This topic has been closed to new replies.