Tagged: 

Viewing 16 posts - 1 through 16 (of 16 total)
  • Author
    Posts
  • #439

    Hi Kriesi & all!

    This is such a fantastic theme, but I’m sure you’ve heard that before. :)

    Thanks for creating this help forum, themeforest is so exhausting!

    I saw the question about adding a search with the solution of using a widget (here: http://www.kriesi.at/support/topic/search-function#post-433).

    This is a fairly sufficient solution (and easy enough to implement), however, I would very much like to have the search available on every page, especially since some pages (ie. the home page and gallery pages) don’t have sidebars.

    I was thinking of maybe making that area above the menu larger (in div wrap_all or wrap_head?), by making a new div and align it to the right?

    I can’t for the life of me figure out how though…any help is greatly appreciated!

    (I’m using the boxed layout and it took me awhile to figure out that .boxed css was making it look like there was an image above the logo & menu – “wrapper_head” div!)

    #31384

    Hi!

    You can add this code to header.php where you’d like the search form to appear:

    <?php get_search_form();?>

    You may have to play around with the CSS to get the layout just right.

    Regards,

    James

    #31385

    Thanks James but can you be a little more specific? When I put that code in my header it looks like crap. It sticks the search field and a button with only a period in it in the upper left corner of the header. It doesn’t look anything like the search field in the footer of the demo site.

    Thanks again.

    #31386

    You’d need to add CSS to set up the search form as you’d like it, the code for the footer styling is specific to the footer. For the placement in the header.php file it’s up to you but I’d do something like this:

    <div class="center">

    <div id="head">

    <h2 class="logo <?php echo $logoclass; ?>"><a class='ie6fix' href="<?php echo get_settings('home'); ?>/"><?php echo $logo; ?></a></h2>

    <!-- Navigation for Pages starts here -->
    <?php
    wp_nav_menu( array( 'menu' => 'Main',
    'container' =>false,
    'menu_class' => 'nav',
    'echo' => true,
    'fallback_cb' => 'kriesi_fallback_menu',
    'before' => '',
    'after' => '',
    'link_before' => '',
    'link_after' => '',
    'depth' => 0,
    'context' => 'frontend',
    'walker' => new kclass_description_walker())
    );
    ?>

    <div class="search"><?php get_search_form();?></div>

    <!--end head-->
    </div>

    <!-- end center-->
    </div>

    I’d add this to the end of style.css:

    #head .search { position: absolute; top: 5px; right: 5px; }

    #head .search #searchform{ position: relative; }

    #head .search #searchsubmit{ }

    #head .search #s{ width: 113px; position: relative; }

    Exactly how you want to set up the search form is up to you, so use this code as a template and change elements to suit your needs / style.

    #31387

    Thanks again James. I copied your code and pasted it into my header.php (as well as copying the css code and adding it to the stylesheet) to get an idea of what it would look like and when I refreshed my page nothing happened. No search field appeared in the head section of my site.

    I’ve waited several minutes, cleared my cache, but still nothing.

    Am I doing something wrong?

    Russ

    #31388

    Hey James,

    Now the website is coming back with an error code. I’ve deleted the code from my header so the site is back to normal but below is the error code that was displayed on the website.

    Fatal error: Class ‘kclass_description_walker’ not found in /home/samsill/public_html/wp-content/themes/altegobrand/header.php on line 25

    Any idea what’s causing this?

    Russ

    #31389

    Interesting, the kclass_description_walker class controls the Navigation Menu.

    Have any files been changed or deleted? 1st step to fix this would be to re-upload all the theme files and see if the problem persists.

    #31390

    Hey James,

    No changes have been made to any files other than the stylesheet. All work has been done using the Display Options.

    Russ

    #31391

    Have you tried re-uploading the files?

    If you have and the problem persists, can you set me up an FTP / SFTP account and a WordPress Admin account and email the details to support {at} jamesmorrisondesign {dot} com with the subject:

    Kriesi | Avisio | russriedle | Add Search To Header

    and I’ll check it out.

    #31392

    I found this thread and used it affectively to make the changes I wanted to. But in doing so I deactivated the links working in the breadcrumbs? My first thought was I forgot to close out a div tag. I’ve looked over the code hard and found nothing wrong?

    I will admit I’m new to .php, and I’m thinking that’s where the error is. I was having trouble figuring out where to insert <?php get_search_form();?>

    This is what I ended up doing in header.php (mind you I removed the additional header previously)

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <?php global $k_option, $query_string; $k_option['custom']['real_query'] = $query_string; ?>
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head profile="http://gmpg.org/xfn/11">

    <!-- basic meta tags -->
    <meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php bloginfo('charset'); ?>" />
    <?php

    if (function_exists('khelper_follow_nofollow')) khelper_follow_nofollow();
    // outputs a rel=follow or nofollow tag to circumvent google duplicate content for archives
    // located in framework/helper_functions/lots_of_small_helpers.php

    ?>

    <!-- title -->
    <title><?php if (is_home()) { bloginfo('name'); ?><?php } elseif (is_category() || is_page() ||is_single()) { ?> <?php } ?><?php wp_title(''); ?></title>

    <!-- feeds and pingback -->
    <link rel="alternate" type="application/rss+xml" title="<?php bloginfo('name'); ?> RSS2 Feed" href="<?php bloginfo('rss2_url'); ?>" />
    <link rel="pingback" href="<?php bloginfo('pingback_url'); ?>" />

    <!-- stylesheets -->
    <link rel="stylesheet" href="<?php echo bloginfo('template_url'); ?>/js/prettyPhoto/css/prettyPhoto.css" type="text/css" media="screen"/>
    <link rel="stylesheet" href="<?php bloginfo('stylesheet_url'); ?>" type="text/css" media="screen" />

    <?php $skin = $k_option['general']['skin'] != '' ? $k_option['general']['skin'] : 1; ?>
    <link rel="stylesheet" href="<?php echo bloginfo('template_url'); ?>/css/style<?php echo $skin; ?>.css" type="text/css" media="screen"/>

    <!-- ########## end css ########## -->

    <!-- scripts -->

    <!--[if IE 6]>
    <script type='text/javascript' src='<?php echo bloginfo('template_url'); ?>/js/dd_belated_png.js'></script>
    <script>DD_belatedPNG.fix('.ie6fix, blockquote');</script>
    <style>.box ul li a, li, .hr {zoom:1;}</style>
    <![endif]-->
    <!--[if lt IE 9]>
    <style>.boxed {border:1px solid #fff}</style>
    <![endif]-->

    <!-- Make Slideshow variables available for Javascript-->
    <script type='text/javascript'>
    slideShowArray = [];
    <?php
    foreach ($k_option['slideshow'] as $key=>$value)
    {
    echo "slideShowArray['".$key."'] = '".$value."'; n";
    }
    ?>
    </script>

    <?php
    ######################################################################
    # PHP scripts
    ######################################################################
    // single post comment reply script by wordpress
    if ( is_singular() ) wp_enqueue_script( 'comment-reply' );

    #set the fonts and colors defined at the backend
    $applyCustomFontTo = '#top h1, #top h2, #top h3, #top h4, #top h5, #top h6, #top legend, #top .sliderheading, .big_button strong, .dynamicFont';
    $applyBackgroundColorTo = 'div .dropcap2, div .dropcap3, div .dynamicBg, body .boxed, div .button, #top div .pagination a:hover';
    $applyFontColorTo = 'div a, div a:hover';

    $k_option['custom']['styling']->set_cufon_font($applyCustomFontTo, $k_option['general']['font_heading']);
    $k_option['custom']['styling']->set_element_background($applyBackgroundColorTo);
    $k_option['custom']['styling']->set_font_color($applyFontColorTo);
    $k_option['custom']['styling']->show();
    //wp-head hook, needed for plugins, do not delte
    wp_head();

    ?>

    <!-- meta tags, needed for javascript -->
    <meta name="temp_url" content="<?php echo get_bloginfo('template_url'); ?>" />

    </head>

    <?php
    ######################################################################
    # check for custom logo
    ######################################################################
    if (isset($k_option['general']['logo']) && $k_option['general']['logo'] != '')
    {
    $logo = '<img class="ie6fix" src="'.$k_option['general']['logo'] .'" alt="'.get_settings('home').'" />';
    $logoclass = 'logoimg';
    }
    else // default logo
    {
    $logo = get_bloginfo('name');
    $logoclass = 'logobg';
    }

    ######################################################################
    # check which page and apply classes to body
    ######################################################################
    $k_option['custom']['bodyclass'] = '';

    ?>

    <body id='top' <?php body_class($k_option['custom']['bodyclass']);?> >
    <div id='wrap_all' class='<?php echo $k_option['general']['layout_style']; ?>'>
    <div class="wrapper" id='wrapper_head'>

    <div class="center">

    <div id="head">

    <h2 class="logo <?php echo $logoclass; ?>"><a class='ie6fix' href="<?php echo get_settings('home'); ?>/"><?php echo $logo; ?></a></h2>

    <!-- Navigation for Pages starts here -->
    <?php
    wp_nav_menu( array( 'menu' => 'Main',
    'container' =>false,
    'menu_class' => 'nav',
    'echo' => true,
    'fallback_cb' => 'kriesi_fallback_menu',
    'before' => '',
    'after' => '',
    'link_before' => '',
    'link_after' => '',
    'depth' => 0,
    'context' => 'frontend',
    'walker' => new kclass_description_walker())
    );
    ?>

    <!--end head-->
    </div>

    <!-- end center-->
    </div>
    <!--end wrapper-->
    </div>

    <?php

    #breadcrumb navigation
    if(!is_front_page()){
    /*REMOVING ADDITIONAL HEADING
    if($k_option['custom']['headlineContent'] == '')
    {
    $headline = get_post_meta($post->ID, "_headline", true);
    if($headline != "") $headline = '<h2>'.$headline.'</h2>';
    }
    else
    {
    $headline = $k_option['custom']['headlineContent'];
    }
    echo '<div class="wrapper wrapper_heading ie6fix" id="wrapper_featured_area">';
    echo '<div class="overlay_top ie6fix"></div>';
    echo '<div class="overlay_bottom ie6fix">';

    echo '</div>';

    echo '<div class="center">';
    if($headline != "") echo $headline;
    echo '</div></div>';
    END REMOVING ADDTIONAL HEADING*/
    echo '<div class="wrapper" id="wrapper_stripe">';
    if(class_exists('kclass_breadcrumb')){ $bc = new kclass_breadcrumb; get_search_form();}
    echo '</div>';
    }
    ?>

    The CSS for the search bar:

    /*searchform*/
    #searchform{
    position: relative;
    margin:0 auto;
    width:940px;
    text-align: right;
    }

    #s{
    width:194px;
    position: relative;
    }

    The site can be viewed at http://www.scottfoleymultimedia.com

    Any help would be greatly appreciated.

    ~cheers~

    I just realized this thread isn’t pertaining to Avisio, I hope you all can still help.

    `

    #31393

    Hey,

    This is already answered above: http://www.kriesi.at/support/topic/add-search-to-the-header#post-1792 :)

    James

    #31394

    I’m trying to put the search form in the same div as the breadcrumbs? Where it occupies the empty white space on the right side of the bread crumb div and isn’t visible on the home page.

    Forgive me if this is a stupid question, I’m new with php…

    #31395

    Try following code:

    echo '<div class="wrapper" id="wrapper_stripe">';
    if(class_exists('kclass_breadcrumb')){ $bc = new kclass_breadcrumb;}
    get_search_form();
    echo '</div>';

    #31396

    This is the weirdest thing. It works as far as putting it in the same div and placement. But again, the links in the breadcrumbs are no longer active?

    #31397

    I had the same situation and settled on the following solution. I expanded the breadcrumb bar area and included a right aligned (with padded offset) search box. In addition, I customized the search URI to search a default taxonomy category when in portfolio view and search the currently displayed category (taxonomy or tag) otherwise.

    Here’s the code:

    Add this to style.css:

    Code:
    .breadcrumb_search { /*right align content area */
    float: right;
    padding: 0px 45px 0px 0px;

    And this to header.php after if(class_exists(‘kclass_breadcrumb’)){ $bc = new kclass_breadcrumb; }:

    Code:
    // Output search box as part of breadcrumb bar
    $search_uri = is_tax() ? ‘.’ : ‘/portfolio_entries/YOUR_DEFAULT_SEARCH_TAX_CATEGORY/';
    echo ‘<div class=’breadcrumb_search’>’
    . ‘<form method=”get” id=”searchform” action=”‘ . $search_uri . ‘”>’
    . ‘<div><input type=”text” class=’rounded text_input’ value=”” name=”s” id=”s” />’
    . ‘<input type=”submit” class=”button ie6fix” id=”searchsubmit” value=”Search ” />’
    . ‘</div></form></div>';

    #31398

    Thanks for providing your solution nigele :)

Viewing 16 posts - 1 through 16 (of 16 total)

The topic ‘Add Search to the header?’ is closed to new replies.