Jump to content

Wordpress theme header issue


ingvarorn

Recommended Posts

Hi, I have some issue with adding a small banner in a header of a wordpress theme.
 
I add the code to the banner through settings in the theme who then utilizes  masthead-right-content
 
The issues are.
1. The search text box and the button always gets seperated.
2. There is a huge trailing space after the banner who irritates me to hell.
 
This is how it looks like when I try to add the banner.
06.06.2015-02.04.png
 
The site is islendingabok.net
 
I hope someone out there can help me, I add all the info I think you need to see the issue below, let me know if your need more.
 
 
The header php is
<?php
/**
 * The Header for our theme.
 *
 * Displays all of the <head> section and everything up till <div id="main">
 *
 * @package WordPress
 * @subpackage Pytheas
 * @since Pytheas 1.0
 */
?>


<!DOCTYPE html>


<!-- WordPress Theme by WPExplorer (http://www.wpexplorer.com) -->
<html <?php language_attributes(); ?>>
<head>
<meta charset="<?php bloginfo( 'charset' ); ?>" />
<meta name="viewport" content="width=device-width" />
<title><?php wp_title(''); ?><?php if( wp_title('', false) ) { echo ' |'; } ?> <?php bloginfo('name'); ?></title>
<link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>" />
<?php wp_head(); ?>


<script>
var _prum = [['id', '537f32c0abe53d6a272fba27'],
            ['mark', 'firstbyte', (new Date()).getTime()]];
(function() {
   var s = document.getElementsByTagName('script')[0]
     , p = document.createElement('script');
   p.async = 'async';
   p.src = '//rum-static.pingdom.net/prum.min.js';
   s.parentNode.insertBefore(p, s);
})();
</script>




</head>


<!-- Begin Body -->
<body <?php body_class('body'); ?>>


    <div id="wrap" class="container clr">
    
        <header id="masthead" class="site-header clr" role="banner">
        
            <div class="logo">
                <?php if ( of_get_option('custom_logo') ) { ?>
                    <a href="<?php echo esc_url( home_url( '/' ) ); ?>" title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>
" rel="home"><img src="<?php echo of_get_option('custom_logo'); ?>" alt="<?php get_bloginfo( 'name' ) ?>" /></a>
                <?php } else { ?>
                    <?php if ( is_front_page() ) { ?>
                    <h1><a href="<?php echo esc_url( home_url( '/' ) ); ?>" title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>
" rel="home"><?php echo get_bloginfo( 'name' ); ?></a></h1>
                    <?php } else { ?>
                    <h2><a href="<?php echo esc_url( home_url( '/' ) ); ?>" title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>
" rel="home"><?php echo get_bloginfo( 'name' ); ?></a></h2>
                    <?php }
if ( get_bloginfo('description') ) {
echo '<p class="site-description">'. get_bloginfo('description') .'</p>';
} ?>
                    <?php } ?>
            </div><!-- .logo -->   
             
            <div class="masthead-right">
             <?php if ( of_get_option('masterhead_right','<i class="icon-phone"></i>Call us: 999-99-99') !== '' ) { ?>
                 <div class="masthead-right-content">
                 <?php echo of_get_option('masterhead_right','<i class="icon-phone"></i>Call us: 999-99-99'); ?>
                 </div><!-- .masterhead-right-content -->
                <?php } ?>
                <?php if ( of_get_option('masthead_search','1') ) { ?>
                    <div class="masthead-search">
                        <?php get_search_form(); ?>
                    </div><!-- /masthead-search -->
                <?php } ?>
            </div><!-- .masthead-right -->
       
        </header><!-- .header -->
        
    
        <div id="navbar" class="navbar clr">
        
         <nav id="site-navigation" class="navigation main-navigation clr" role="navigation">
             <span class="nav-toggle"><?php _e( 'Menu', 'wpex' ); ?><i class="toggle-icon icon-arrow-down"></i></span>
<?php wp_nav_menu( array(
                    'theme_location' => 'main_menu',
                    'sort_column' => 'menu_order',
                    'menu_class' => 'nav-menu dropdown-menu',
                    'fallback_cb' => false,
                    'walker' => new WPEX_Dropdown_Walker_Nav_Menu()
                ) ); ?>
            </nav><!-- #site-navigation -->
            
<?php if ( of_get_option('social','1') == '1') wpex_display_social(); ?>
            
        </div><!-- #navbar -->
        
    <div id="main" class="site-main row clr fitvids">
    
<?php if ( is_singular('page') && has_post_thumbnail() ) { ?>
            <div id="page-featured-img">
                <?php global $post; the_post_thumbnail( $post->ID ); ?>
            </div><!-- #page-featured-img -->
        <?php } ?>
        
        <?php
        //Yoast SEO breadcrumbs
        if ( !is_front_page() && !is_404() ) {
            if( function_exists('yoast_breadcrumb') ) {
                yoast_breadcrumb('<nav id="breadcrumbs">','</nav>');
            }
        } ?>
The searchform.php is
<?php
/**
 * The template for displaying search forms in Pytheas.
 *
 * @package WordPress
 * @subpackage Pytheas
 * @since Pytheas 1.0
 */
?>


<form method="get" id="searchform" class="searchform" action="<?php echo esc_url( home_url( '/' ) ); ?>" role="search">
<input type="search" class="field" name="s" value="<?php echo esc_attr( get_search_query() ); ?>" id="s" placeholder="<?php echo esc_attr_x( 'Search …', 'placeholder', 'wpex' ); ?>" />
    <button type="submit" class="submit" id="searchsubmit"><i class="icon-search"></i></button>
</form>

The code I try to add to the header is

<a href="http://eimskip.is/IS/utflutningur/b%C3%BAsl%C3%B3%C3%B0aflutningar/default.html" target="_blank"><img src="http://www.islendingabok.net/wp-content/uploads/2015/06/buslodir_islendingabok-02.png " alt="Eimskip er styrktar aðili síðunnar" /></a>

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.