Trying to add an image in the header of a wordpress site and it is displaying in firefox but not chrome. the other issue is safari has it cut off from the side. Could anyone give me some insight? Here is my code for the header.php
the website is http://www.cacaobox.com/
<?php
/**
* #package WordPress
* #subpackage Everything
* #since 1.0
*/
?>
<!DOCTYPE html >
<!--[if lt IE 9]>
<html class="no-js ie lt-ie9 <?php the_field('custom_class'); ?>" <?php language_attributes(); ?>> <![endif]-->
<!--[if IE 9]> <html class="no-js ie ie9 <?php the_field('custom_class'); ?>" <?php language_attributes(); ?>> <![endif]-->
<!--[if (gt IE 9)|!(IE)]><!--><html class="no-js no-ie <?php the_field('custom_class'); ?>" <?php language_attributes(); ?>>
<!--<![endif]-->
<head>
<meta charset="<?php bloginfo('charset'); ?>" />
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1" />
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<!--[if lt IE 9]>
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"> </script>
<script src="<?php echo Everything::getInstance()->template_uri; ?>/data/js/selectivizr.min.js"></script>
<![endif]-->
<title>CacaoBox</title>
<?php wp_head(); ?>
<link rel="icon" href="http://www.cacaobox.com/wp-content/uploads/2015/10/favicon.png" type="image/png" rel="shortcut icon" />
<link rel="shortcut icon" http://www.cacaobox.com/wp-content/uploads/2015/10/favicon.png" type="image/png" />
<link rel="stylesheet" type="text/css" media="all" href="<?php bloginfo('template_directory'); ?>/Responsive.css" />
<link rel="stylesheet" type="text/css" media="all" href="<?php bloginfo('template_directory'); ?>/style.css" />
<body <?php
if (!is_null($background = Everything::io_('layout/background/background', 'general/background/background', '__hidden_ns', '__hidden'))) {
if ($background instanceof \Drone\Options\Option\ConditionalTags) {
$background = $background->option();
}
echo $background->attrs();
} else {
body_class();
}
?>>
<div class="container">
<div id="wrapper">
<div id="top-bar" class="outer-container edge-bar<?php if (Everything::to_('header/top_bar/settings')->value('fixed') || Everything::to_('header/style/settings')->value('fixed')) echo ' fixed'; ?>">
<?php foreach (array('desktop', 'mobile') as $device): ?>
<?php
$items = Everything::to("header/top_bar/{$device}/items", '__hidden', array());
if ($device == 'mobile' && Everything::to_('header/top_bar/settings')->value('mobile_toggle')) {
array_unshift($items, 'mobile_toggle');
}
if (count($items) > 1):
?>
<div class="container <?php echo $device ?>-only">
<section class="section">
<div class="alignleft fixed"><?php
foreach ($items as $item) {
switch ($item) {
case '_':
echo '</div><div class="alignright fixed">';
break;
case 'tagline':
echo '<span>';
if ($device == 'mobile') {
echo Everything::to(array('header/tagline/mobile/text', 'header/tagline/text'), '__hidden', get_bloginfo('description'));
} else {
echo Everything::to('header/tagline/text', '__hidden', get_bloginfo('description'));
}
echo '</span>';
break;
case 'search':
echo \Drone\HTML::div()
->addClass('search-box', is_search() ? 'opened' : null)
->add(preg_replace('/ placeholder="[^"]*"/', '', get_search_form(false)))
->html();
break;
case 'cart':
echo Everything::woocommerceGetCartInfo('small');
break;
case 'menu':
echo '<nav class="top-nav-menu">';
Everything::navMenu('top-bar-'.$device, null, 1);
echo '</nav>';
break;
case 'lang_menu':
if (count(icl_get_languages('skip_missing=0')) > 0) {
echo '<nav class="top-nav-menu lang">';
Everything::langMenu();
echo '</nav>';
}
break;
case 'mobile_toggle':
if (Everything::to_('header/main_menu/visible')->value('mobile')) {
echo '<a id="mobile-section-toggle" title="'.__('Menu', 'everything').'"><i class="icon-menu"></i></a>';
}
break;
}
}
?></div>
</section>
</div><!-- // .container -->
<?php endif; ?>
<?php endforeach; ?>
">
<div class="usda-wrapper">
<div class="usda">
<img src="http://www.cacaobox.com/wp-content/uploads/2016/03/USDA-Organic-Seal.png" style="width:80px"/>
</div>
</div>
<div class="container">
<div class="section">
<span class="helper">
<?php if (Everything::to_('header/main_menu/visible')->value('mobile') && !Everything::to_('header/top_bar/settings')->value('mobile_toggle')): ?>
<a id="mobile-section-toggle" title="<?php _e('Menu', 'everything'); ?>"><i class="icon-menu"></i></a>
<?php endif; ?>
</span>
<?php if (Everything::to_('header/style/settings')->value('centered')) echo '<div>'; ?>
<h1 id="logo"<?php if (Everything::to('header/logo/shrunken', '__hidden')) echo ' class="shrunken"'; ?>>
<?php $name = get_bloginfo('name', 'display'); ?>
<a href="<?php echo esc_url(home_url('/')); ?>" title="<?php echo esc_attr($name); ?>" rel="home"><?php
if (Everything::to_('header/logo/image')->property('image1x')) {
echo Everything::to_('header/logo/image')->image()->alt($name)->html();
} else {
echo $name;
}
?></a>
</h1><!-- // #logo -->
<?php if (Everything::to_('header/main_menu/visible')->value('desktop')): ?>
<nav class="nav-menu main">
<?php Everything::navMenu('main-desktop'); ?>
</nav>
<?php endif; ?>
<?php if (Everything::to_('header/style/settings')->value('centered')) echo '</div>'; ?>
<span class="helper">
<?php echo Everything::woocommerceGetCartInfo('big', Everything::to('header/cart/visible', '__hidden', array())); ?>
</span>
</div>
<div id="mobile-section">
<?php if (Everything::to_('header/main_menu/visible')->value('mobile')): ?>
<nav class="mobile-nav-menu main">
<?php Everything::navMenu('main-mobile'); ?>
</nav>
<?php if (\Drone\Func::wpAssignedMenu('additional-mobile')): ?>
<nav class="mobile-nav-menu additional">
<?php Everything::navMenu('additional-mobile', null, 1); ?>
</nav>
<?php endif; ?>
<?php endif; ?>
</div>
</div><!-- // .container -->
<div class="container">
<?php Everything::beginContent(); ?>
Related
For some reason my contact form is showing up above my wordpress header as shown below:
Here is my code:
<?php
/**
* Template Name: Contact Us
*
* #package WordPress
* #subpackage Creativeforces
* #since Creativeforces Group 1.0
*/
?>
<head>
<meta charset="utf-8">
<title>Creative Forces | Contact Us</title>
<link rel="stylesheet" type="text/css" href="/wp-content/themes/creativeforces/css/contact.css">
<link href='https://fonts.googleapis.com/css?family=Roboto+Condensed:400,700' rel='stylesheet' type='text/css'>
</head>
<header>
<?php while ( have_posts() ) : the_post() ?>
<?php the_content(); ?>
<?php endwhile; ?>
<?php get_sidebar(); ?>
</header>
<?php get_header(); ?>
<?php get_footer(); ?>
and on the contact page in wordpress admin I have the shortcode:
[contact-form-7 id="131" title="Contact form 1"]
here is header.php id needed:
<?php
/**
* The template for displaying the header
*
* Displays all of the head element and everything up until the "site-content" div.
*
* #package WordPress
* #subpackage Creativeforces
* #since Creativeforces 1.0
*/
?>
<html xmlns="http://www.w3.org/1999/xhtml" <?php language_attributes(); ?>>
<head profile="http://gmpg.org/xfn/11">
<meta http-equiv="content-type" content="<?php bloginfo('html_type'); ?>; charset=<?php bloginfo('charset'); ?>" />
<link rel="stylesheet" type="text/css" href="<?php bloginfo('stylesheet_url'); ?>" />
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" integrity="sha384-1q8mTJOASx8j1Au+a5WDVnPi2lkFfwwEAa8hDDdjZlpLegxhjVME1fgjWPGmkzs7" crossorigin="anonymous">
<script type="text/javascript" src="https://js.stripe.com/v2/"></script>
<?php wp_head(); ?>
<link rel="alternate" type="application/rss+xml" href="<?php bloginfo('rss2_url'); ?>" title="<?php printf( __( '%s latest posts', 'your-theme' ), wp_specialchars( get_bloginfo('name'), 1 ) ); ?>" />
<link rel="alternate" type="application/rss+xml" href="<?php bloginfo('comments_rss2_url') ?>" title="<?php printf( __( '%s latest comments', 'your-theme' ), wp_specialchars( get_bloginfo('name'), 1 ) ); ?>" />
<link rel="pingback" href="<?php bloginfo('pingback_url'); ?>" />
</head>
<body data-spy="scroll" data-target=".navbar">
<div class="black-line"></div>
<!-- LOGO -->
<?php if ( get_theme_mod( 'themeslug_logo' ) ) : ?>
<div class='site-logo'>
<a href='<?php echo esc_url( home_url( '/' ) ); ?>' title='<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>' rel='home'><img src='<?php echo esc_url( get_theme_mod( 'themeslug_logo' ) ); ?>' alt='<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>'></a>
</div>
<?php else : ?>
<!-- Displayes blog title and description -->
<hgroup>
<h1 class='site-title'><a href='<?php echo esc_url( home_url( '/' ) ); ?>' title='<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>' rel='home'><?php bloginfo( 'name' ); ?></a></h1>
<h2 class='site-description'><?php bloginfo( 'description' ); ?></h2>
</hgroup>
<?php endif; ?>
<!-- Top-Nav-Menu -->
<div id="menu" class="navbar text-center">
<?php wp_nav_menu( array( 'sort_column' => 'menu_order', 'container_class' => 'menu-header', 'container' => 'nav', 'theme_location' => 'header-menu', 'walker' => new wp_bootstrap_navwalker()) ); ?>
</div>
any help would be appreciated!
You have placed wp_header() after the the_content()
It should next to tag.
Generally It is like -
- header
- content
- footer
Here is the code after modification -
<?php
/**
* Template Name: Contact Us
*
* #package WordPress
* #subpackage Creativeforces
* #since Creativeforces Group 1.0
*/
?>
<head>
<meta charset="utf-8">
<title>Creative Forces | Contact Us</title>
<link rel="stylesheet" type="text/css" href="/wp-content/themes/creativeforces/css/contact.css">
<link href='https://fonts.googleapis.com/css?family=Roboto+Condensed:400,700' rel='stylesheet' type='text/css'>
</head>
<body>
<header>
<?php get_header(); ?>
</header>
<?php while ( have_posts() ) : the_post() ?>
<?php the_content(); ?>
<?php endwhile; ?>
<?php get_sidebar(); ?>
<footer>
<?php get_footer(); ?>
</footer>
You are adding content/sidebar inside header section and after that this header has been added so that's the reason your contact form 7 is appearing above the header.
Please try like this
<header>
<?php get_header(); ?>
</header>
<div class="contentdiv">
<?php while ( have_posts() ) : the_post() ?>
<?php the_content(); ?>
<?php endwhile; ?>
<?php get_sidebar(); ?>
</div>
My site has suddenly started not showing featured content graphics or my logo on single post pages, however shows normally on all other pages.
For example this page shows the logo top left: http://totallybigbrother.co.uk/news/
and this page doesn't: http://totallybigbrother.co.uk/big-brother-2014-housemates-first-impressions/
Also, on the second link, the 'Related Posts' area near the bottom was previously 4 images with wording below them.
This has happened on it's own. Does anyone have any suggestions? Thank you in advance.
<!DOCTYPE html>
<html <?php language_attributes(); ?>>
<head>
<?php global $data ?>
<meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php bloginfo('charset'); ?>"/>
<title><?php wp_title('«', true, 'right'); bloginfo('name'); ?> - <?php bloginfo('description'); ?> </title>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<link rel="stylesheet" href="<?php bloginfo('stylesheet_url'); ?>" type="text/css" media="screen" />
<?php if(is_rtl()) { ?>
<link rel="stylesheet" href="<?php echo Lioit_URI; ?>/rtl.css" type="text/css" media="screen" />
<?php } else {?>
<?php }?>
<link rel="pingback" href="<?php bloginfo('pingback_url'); ?>" />
<link rel="alternate" type="application/rss+xml" title="RSS 2.0" href="<?php bloginfo('rss2_url'); ?>" />
<?php if(!empty($data['custom_favicon'])) { ?><link rel="icon" type="image/png" href="<?php echo $data['custom_favicon']; ?>" /><?php } ?>
<!--[if lt IE 9]>
<script src="http://ie7-js.googlecode.com/svn/version/2.1(beta4)/IE9.js"></script>
<![endif]-->
<?php echo stripslashes($data['code_header']); ?>
<?php if ( is_singular() ) wp_enqueue_script( 'comment-reply' ); ?>
<?php require Lioit_TM . '/css.php';?>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
<link rel="stylesheet" type="text/css" href="http://www.totallybigbrother.co.uk/wp-content/themes/liomagazine/ddimgtooltip.css" />
<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="en-US" xmlns:og="http://ogp.me/ns#" xmlns:fb="http://www.facebook.com/2008/fbml">
<script type="text/javascript" src="http://www.totallybigbrother.co.uk/wp-content/themes/liomagazine/ddimgtooltip.js">
<?php if(is_front_page()) { ?>
<style> .mainWidgets { margin-top:-363px !important} </style>
<?php }; ?>
/***********************************************
* Image w/ description tooltip v2.0- (c) Dynamic Drive DHTML code library (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit Dynamic Drive at http://www.dynamicdrive.com/ for this script and 100s more
***********************************************/
</script>
<!-- BEGIN Tynt Script -->
<script type="text/javascript">
if(document.location.protocol=='http:'){
var Tynt=Tynt||[];Tynt.push('dZ977cXJir44ASacwqm_6r');
(function(){var s=document.createElement('script');s.async="async";s.type="text/javascript";s.src='http://tcr.tynt.com/ti.js';var h=document.getElementsByTagName('script')[0];h.parentNode.insertBefore(s,h);})();
}
</script>
<!-- END Tynt Script -->
<?php wp_head(); ?>
</head>
<body <?php body_class(); ?>>
<?php if($data['theme_width'] == 'fixed') { ?>
<div id="fixedContainer">
<?php } else { ?>
<div id="container">
<?php }?>
<div id="header" class="loadSmooth">
<div id="logo">
<?php if($data['custom_logo'] !='') { ?>
<a href="<?php echo home_url(); ?>/" title="<?php bloginfo( 'name' ); ?>" rel="home">
<img src="<?php echo $data['custom_logo']; ?>" alt="<?php bloginfo( 'name' ) ?>" />
</a>
<?php } else { ?>
<a href="<?php echo home_url(); ?>/" title="<?php bloginfo( 'name' ); ?>" rel="home">
<img src="<?php echo Lioit_IMG; ?>/logo.png" alt="<?php bloginfo('name'); ?>" title="<?php bloginfo('name'); ?>" />
</a>
<?php } ?>
</div><!--End Logo-->
<div id="banner">
<center>
<script type="text/javascript" language="javascript" src="http://www2.glam.com/app/site/affiliate/viewChannelModule.act?mName=viewAdJs&affiliateId=1648491755&adSize=728x90"></script>
</center>
</div>
<div id="content" class="loadSmooth">
<!--End Banner-->
</div><!--End Main Header-->
</div><!--End Header-->
<div class="topBar loadSmooth">
<div class="inner">
<div id="hmbar">
<div style="padding-left:0px; margin-top: -1px; margin-left: 18px;">
</div>
<div style="margin: -50px auto auto -3px; position: static; width: 990px; ">
<a href="http://totallybigbrother.co.uk/ash-harrison/" rel="imgtip[15]">
<img src="http://totallybigbrother.co.uk/Housemates/ASH%20HARRISON.png" style="margin-top:4px" alt="Housemate"></a>
<a href="http://totallybigbrother.co.uk/ashleigh-coyle/" rel="imgtip[13]">
<img src="http://totallybigbrother.co.uk/Housemates/ASHLEIGH%20COYLE.png" alt="Housemate"></a>
<a href="http://totallybigbrother.co.uk/mark-byron/" rel="imgtip[2]">
<img src="http://totallybigbrother.co.uk/Housemates/MARK%20BYRON.png" alt="Housemate"></a>
<a href="http://totallybigbrother.co.uk/helen-wood/" rel="imgtip[3]">
<img src="http://totallybigbrother.co.uk/Housemates/HELEN%20WOOD.png" alt="Housemate"></a>
<a href="http://totallybigbrother.co.uk/new-housemate-pavandeep-paul-profile/">
<img src="http://totallybigbrother.co.uk/wp-content/uploads/2014/07/PAVANDEEP-PAUL.png" alt="Housemate"></a>
<a href="http://totallybigbrother.co.uk/steven-goode/" rel="imgtip[4]">
<img src="http://totallybigbrother.co.uk/Housemates/STEVEN%20GOODE.png" alt="Housemate"></a>
<a href="http://totallybigbrother.co.uk/winston-showan/" rel="imgtip[6]">
<img src="http://totallybigbrother.co.uk/Housemates/WINSTON%20SHOWAN.png" alt="Housemate"></a>
<a href="http://totallybigbrother.co.uk/christopher-hall/" rel="imgtip[9]">
<img src="http://totallybigbrother.co.uk/Housemates/CHRISTOPHER%20HALL.png" alt="Housemate"></a>
<a href="http://totallybigbrother.co.uk/chris-r-wright/" rel="imgtip[12]">
<img src="http://totallybigbrother.co.uk/Housemates/CHRIS%20R%20WRIGHT.png" alt="Housemate"></a>
<a href="http://totallybigbrother.co.uk/tamara-steward-wood/" rel="imgtip[1]">
<img src="http://totallybigbrother.co.uk/Housemates/TAMARA%20STEWART-WOOD%20evicted.png" alt="Housemate"></a>
<a href=" http://totallybigbrother.co.uk/danielle-mcmahon/" rel="imgtip[5]">
<img src="http://totallybigbrother.co.uk/wp-content/uploads/2014/07/DANIELLE-McMAHON-evicted.png" alt="Housemate"></a>
<a href="http://totallybigbrother.co.uk/matthew-davies/" rel="imgtip[7]">
<img src="http://totallybigbrother.co.uk/Housemates/MATTHEW%20DAVIES evicted.png" alt="Housemate"></a>
<a href=" http://totallybigbrother.co.uk/kimberly-kisselovich/" rel="imgtip[8]">
<img src="http://totallybigbrother.co.uk/wp-content/uploads/2014/07/KIMBERLY-KISSELOVICH-evicted.png" alt="Housemate"></a>
<a href="http://totallybigbrother.co.uk/pauline-bennett/" rel="imgtip[10]">
<img src="http://totallybigbrother.co.uk/Housemates/PAULINE%20BENNETT%20evicted.png" alt="Housemate"></a>
<a href="http://totallybigbrother.co.uk/toya-washington/" rel="imgtip[11]">
<img src="http://totallybigbrother.co.uk/wp-content/uploads/2014/06/TOYA-A-WASHINGTON-EVICTED.png" alt="Housemate"></a>
<a href="http://totallybigbrother.co.uk/marlon-wallen/ " rel="imgtip[14]">
<img src="http://totallybigbrother.co.uk/wp-content/uploads/2014/07/MARLON-WALLEN-evicted.png" alt="Housemate"></a>
<a href="http://totallybigbrother.co.uk/jale-karaturp/" rel="imgtip[16]">
<img src="http://totallybigbrother.co.uk/wp-content/uploads/2014/07/JALE-KARATURP-evicted.png" alt="Housemate"></a>
</div></div>
<nav>
<?php if ( has_nav_menu( 'mainmenu' ) ) { ?>
<?php wp_nav_menu ( array( 'menu_id' => 'topNavigation','container'=> '', 'theme_location' => 'mainmenu' )); ?>
<?php } else { ?>
<ul id="topNavigation">
<li class="active <?php if (is_home()) {echo "current_page_item";} ?>"><?php _e('Home' , 'lioit' ) ?></li>
<?php wp_list_pages(array(
'title_li' => false
)); ?>
</ul>
<?php } ?>
</nav>
<div class="topRss">
<?php if(!empty($data['social_header'])) { ?>
<?php require Lioit_TM . '/social.php';?>
<?php } ?>
</div><!--End topRss-->
</div><!--End Top Bar Content-->
</div><!--End TopBar-->
<div id="mainNavigation" class="navigation loadSmooth">
<div class="inner">
<nav class="primary container">
<?php if ( has_nav_menu( 'mainnav' ) ) { ?>
<?php wp_nav_menu ( array( 'menu_id' => 'dropmenu','container'=> 'ul', 'theme_location' => 'mainnav' )); ?>
<?php } else { ?>
<ul id="dropmenu">
<li class="<?php if (is_home()) {echo "current_page_item";} ?> home"><?php _e('Home' , 'lioit' ) ?></li>
<?php wp_list_categories('title_li=');?>
</ul>
<?php } ?>
</nav>
</div><!--End Main Menu--></div><!--End Main Menu-->
<div id="pushdown" style="margin:0 auto; width:970px;">
<script type="text/javascript" src="http://www2.glam.com/app/site/affiliate/viewChannelModule.act?mName=viewAdJs&affiliateId=1648491755&adSize=970x66"> </script>
</div>
<div id="content" class="loadSmooth">
<?php if( is_front_page()) { ?>
<?php if($data['disable_top_bar'] != '0') { ?>
<div class="notification ondemand hide">
<?php if(!empty($data['note'])) { ?>
<p><?php echo $data['note']; ?><?php echo $data['note_text']; ?></p>
<?php } ?>
<a class="close" href="javascript:">
<img src="<?php echo get_template_directory_uri(); ?>/images/icon-close.png" />
</a>
</div>
<?php } ?>
<?php } ?>
<?php if($data['newsticker'] != '0') {
require Lioit_TM . '/ticker.php';
} else {
} ?>
<?php require Lioit_TM . '/top.search.php';?>
The code which creates the related content:
<?php if(!empty($data['show_related'])) { ?>
<?php require Lioit_TM . '/related.php';?>
<?php } ?>
The database errors
wp_users: 1 client is using or hasn't closed the table properly
wp_usermeta: 4 clients are using or haven't closed the table properly
wp_posts: 5 clients are using or haven't closed the table properly
wp_comments: 2 clients are using or haven't closed the table properly
wp_options: 8 clients are using or haven't closed the table properly
wp_postmeta: 8 clients are using or haven't closed the table properly
wp_terms: 4 clients are using or haven't closed the table properly
wp_term_taxonomy: 4 clients are using or haven't closed the table properly
wp_term_relationships: 4 clients are using or haven't closed the table properly
wp_commentmeta: 2 clients are using or haven't closed the table properly
Replace everything from id="logo" to <!--End Logo--> with the below if it still does not work then the page is using different template.
<div id="logo">
<a href="http://totallybigbrother.co.uk/" title="Totally Big Brother 2014 UK on Channel 5" rel="home">
<img src="http://totallybigbrother.co.uk/wp-content/uploads/2014/05/logomobile1.png" alt="Totally Big Brother 2014 UK on Channel 5">
</a>
</div>
So, I'm working on my website, in Wordpress. To say on the beggining, I'm no php coder, I just stambled on this thing working on my wordpress website. I bought a theme and installed Simple Language Switcher plugin. It works but I don't know how to place it where I want. I tried it everywhere in my header.php file but no luck. You can see in the image below where it is right now and where I want it (right, where I wrote HERE). And the link for the plugin:
http://www.mendoweb.be/blog/wordpress-plugin-simple-language-switcher/
This is the code for my language bar:
<?php if( function_exists( 'simple_language_switcher' ) ) { ?>
<div id="simple-language-switcher"><?php simple_language_switcher(); ?></div>
<?php } ?>
Here's my header.php file right now:
<?php
/**
* The Header for our theme.
*
* Displays all of the <head> section and everything up till <main id="main">
*
* #package Terrifico
*/
?><!DOCTYPE html>
<!--[if IE 7]>
<html class="ie ie7" <?php language_attributes(); ?>>
<![endif]-->
<!--[if IE 8]>
<html class="ie ie8" <?php language_attributes(); ?>>
<![endif]-->
<!--[if !(IE 7) | !(IE 8) ]><!-->
<html <?php language_attributes(); ?>>
<!--<![endif]-->
<head>
<?php global $data; ?>
<meta charset="<?php bloginfo( 'charset' ); ?>" />
<meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;">
<title><?php wp_title( '|', true, 'right' ); ?></title>
<link rel="profile" href="" />
<link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>" />
<?php if ($data['enable_favicon'] == 1 ) { ?>
<link rel="shortcut icon" href="<?php echo $data['favicon']; ?>" type="image/x-icon" />
<?php } ?>
<?php // Loads HTML5 JavaScript file to add support for HTML5 elements in older IE versions. ?>
<!--[if lt IE 9]>
<script src="<?php echo get_template_directory_uri(); ?>/js/html5.js" type="text/javascript"></script>
<![endif]-->
<?php terrifico_custom_styling(); ?>
<?php wp_head(); ?>
<?php if ($data['custom_css'] <> "") { ?>
<style type="text/css">
<?php echo $data['custom_css']; ?>
</style>
<?php } ?>
</head>
<body <?php body_class(); ?>>
<div id="grid-container">
<?php if ( $data['top_panel_enable'] == 1 ) { get_template_part( 'top-panel' ); }; ?>
<?php if( function_exists( 'simple_language_switcher' ) ) { ?>
<div id="simple-language-switcher"><?php simple_language_switcher(); ?></div>
<?php } ?>
<div class="clear"></div>
<div id="branding" class="<?php echo $data['layout']; ?>">
<header id="header">
<div id="logo">
<?php if ( $data['text_logo_enable'] != 1 ) { ?>
<img src="<?php echo $data['logo']; ?>" alt="<?php echo $data['logo_alt_text']; ?>"/>
<?php } else { ?>
<?php echo $data['logo_alt_text']; ?>
<?php } ?>
</div>
<?php if ( $data['menu_separated'] != 1 ) { ?>
<div id="nav-holder">
<nav id="site-navigation-in" class="main-navigation" role="navigation">
<?php wp_nav_menu(array('theme_location' => 'main_navigation', 'container' => false,'menu_id'=>'menu-main-navigation','menu_class' => 'sf-menu sf-js-enabled sf-shadow', 'fallback_cb'=> 'terrifico_selectmenu', )); ?>
</nav><!--site-navigation-->
</div>
<?php } ?>
<script type="text/javascript">
var sf=jQuery.noConflict();
sf(window).load(function(){
// superFish
sf('ul.sf-menu').supersubs({
minWidth: 16, // minimum width of sub-menus in em units
maxWidth: 40, // maximum width of sub-menus in em units
extraWidth: 1 // extra width can ensure lines don't sometimes turn over
})
.superfish(); // call supersubs first, then superfish
});
</script>
</div><!--branding-->
<?php if ( $data['menu_separated'] == 1 ) { ?>
<div id="nav-holder" class="<?php echo $data['layout']; ?>">
<nav id="site-navigation" class="main-navigation" role="navigation">
<?php wp_nav_menu(array('theme_location' => 'main_navigation', 'container' => false,'menu_id'=>'menu-main-navigation','menu_class' => 'sf-menu sf-js-enabled sf-shadow', 'fallback_cb'=> 'terrifico_selectmenu', )); ?>
</nav><!--site-navigation-->
</div>
<?php } ?>
<?php if ( $data['front_page_blog_index'] == 1 ) {?>
<?php if (! is_home()) { ?>
<?php if ( $data['page_header_on'] == 1 ) { ?>
<?php get_template_part( 'page-header' ); ?>
<?php } ?>
<?php } ?>
<?php } else { ?>
<?php if ( $data['page_header_on'] == 1 ) { ?>
<?php get_template_part( 'page-header' ); ?>
<?php } ?>
<?php } ?>
The file you need to edit is top-panel.php, in the same directory as header.php. It contains the expanded PHP code for that part of the header in your theme. You can see where it's referenced in header.php here, just above where you currently have the language bar code:
<?php if ( $data['top_panel_enable'] == 1 ) { get_template_part( 'top-panel' ); }; ?>
It's increasingly common for WordPress themes, when their designers want to keep everything tidy, to have usual theme parts like header.php, footer.php, etc. divided even further into sub-files. In other words, top-panel.php is to header.php, like header.php is to index.php.
First, back up any files you edit, then carefully insert the language bar code in top-panel.php so the file looks something like this:
<?php
/**
* #package Terrifico
*/
global $data; ?>
<div id="top-panel" class="<?php echo $data['layout']; ?>">
<div id="info-box">
<?php if ( $data['top_contact_enable'] == 1 ) { get_template_part( 'contact-bar' ); }; ?>
<?php if(class_exists('Woocommerce')) { ?>
<?php if ( $data['header_social_enable'] == 1 && $data['shopping_cart_enable'] == 0 ) { get_template_part( 'social-bar' ); }; ?>
<?php if ( $data['shopping_cart_enable'] == 1 ) { get_template_part( 'shopping-cart' ); } ;?>
<?php } else { ?>
<?php if ( $data['header_social_enable'] == 1 ) { get_template_part( 'social-bar' ); }; ?>
<?php } ?>
/* INSERT LANGUAGE BAR CODE */
<?php if( function_exists( 'simple_language_switcher' ) ) { ?>
<div id="simple-language-switcher"><?php simple_language_switcher(); ?></div>
<?php } ?>
/* END LANGUAGE BAR CODE */
</div><!-- #info-box -->
</div><!-- #top-panel -->
Basically, you want the language bar code to be inside the top-panel <div>. That's the div that contains the other divs for "Have any questions?", social icons, etc.
I don't actually have the theme installed to experiment with right now, but you'll probably have to play a little with the CSS or the code above to get it positioned perfectly. Hope I explained it clearly enough and that this helps.
Below is the PHP code of the WordPress traction theme. I want to show my keywords and description on every post/pages as shown on home page. How do I do this?
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xml:lang="en" xmlns="http://www.w3.org/1999/xhtml">
<head>
<?php if ( is_front_page() ) : ?>
<title><?php bloginfo( 'name' ); ?></title>
<meta name="description" content="<?php if ( is_single() ) {
single_post_title('', true);
} else {
bloginfo('name'); echo " - "; bloginfo('description');
}
?>" />
<meta name="keywords" content="mediafire, free movies, download movies, movies
mediafire, online movies, download mediafire movies, movies online, hindi movies,
bollywood movies, english movies, small movies, high quality, small size, free
download, download, download links" />
<meta http-equiv="author" content="M.Naeem Riaz" />
<?php elseif ( is_404() ) : ?>
<title><?php _e( 'Page Not Found |', 'traction' ); ?> | <?php bloginfo( 'name' );
?></title>
<?php elseif ( is_search() ) : ?>
<title><?php printf(__ ("Search results for '%s'", "traction"),
attribute_escape(get_search_query())); ?> | <?php bloginfo( 'name' ); ?></title>
<?php else : ?>
<title><?php wp_title($sep = '' ); ?> | <?php bloginfo( 'name' );?></title>
<?php endif; ?>
<!-- Basic Meta Data -->
<meta name="Copyright" content="Design is copyright <?php echo date( 'Y' ); ?> The
Theme Foundry" />
<meta http-equiv="imagetoolbar" content="no" />
<meta http-equiv="Content-Type" content="<?php bloginfo( 'html_type' ); ?>;
charset=<?php bloginfo( 'charset' ); ?>" />
<?php if ((is_single() || is_category() || is_page() || is_home()) && (!is_paged())) :
else : ?>
<meta name="robots" content="noindex,follow" />
<?php endif; ?>
<!-- Favicon -->
<link rel="shortcut icon" href="<?php bloginfo( 'stylesheet_directory' ); ?>/images
/favicon.ico" />
<!--Stylesheets-->
<?php if ( ($traction->colorScheme() != 'default' ) ) { ?>
<link href="<?php bloginfo( 'stylesheet_directory' ); ?>/stylesheets/<?php
echo $traction->colorScheme(); ?>.css" type="text/css" media="screen" rel="stylesheet"
/>
<?php } ?>
<link href="<?php bloginfo( 'stylesheet_url' ); ?>" type="text/css" media="screen"
rel="stylesheet" />
<!--[if lt IE 8]>
<link rel="stylesheet" type="text/css" media="screen" href="<?php
bloginfo( 'template_url' ); ?>/stylesheets/ie.css" />
<![endif]-->
<!--WordPress-->
<link rel="alternate" type="application/rss+xml" title="<?php bloginfo( 'name' );
?> RSS Feed" href="<?php bloginfo( 'rss2_url' ); ?>" />
<link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>" />
<!--WP Hooks-->
<?php if ( is_singular() ) wp_enqueue_script( 'comment-reply' ); ?>
<?php wp_enqueue_script( 'jquery' ); ?>
<?php wp_head(); ?>
<!--Scripts-->
<script type="text/javascript" src="<?php bloginfo( 'template_url' );
?>/javascripts/traction.js"></script>
<?php if ( is_front_page() && ($traction->sliderState() != '' ) ) { ?>
<!--Slider-->
<?php
$autoStart = 0;
$slidespeed = 300;
$fadespeed = 200;
if ($traction->sliderSpeed() != '' ) $slidespeed =
$traction->sliderSpeed();
if ($traction->sliderFade() != '' ) $fadespeed =
$traction->sliderFade();
if ($traction->sliderStart() == 'true' ) $autoStart =
$traction->sliderDelay(); else $autoStart = 0;
?>
<script type="text/javascript" charset="utf-8">
jQuery(function(){
jQuery("#feature").loopedSlider({
containerClick: false,
autoStart: <?php echo $autoStart; ?>,
slidespeed: <?php echo $slidespeed; ?>,
fadespeed: <?php echo $fadespeed; ?>,
autoHeight: 1
});
});
</script>
<?php } ?>
</head>
<body <?php body_class($traction->colorScheme()); ?>>
<div class="skip-content"><a href="#content"><?php _e( 'Skip to content',
'traction' ); ?></a></div>
<div id="pg-nav-bg">
<div class="wrapper clear">
<div id="pg-nav">
<ul class="nav">
<?php if ($traction->hideHome() !== 'true' ) : ?>
<li class="page_item <?php if
(is_front_page()) echo( 'current_page_item' );?>"><a href="<?php bloginfo( 'url' );
?>"><?php _e( 'Home', 'traction' ); ?></a></li>
<?php endif; ?>
<?php if ($traction->hidePages() !== 'true' ) : ?>
<?php wp_list_pages( 'title_li=&exclude='.
$traction->excludedPages()); ?>
<?php endif; ?>
</ul>
</div><!--end pg-nav-->
</div><!--end wrapper-->
</div><!--end page-navigation-bg-->
<div class="wrapper big">
<div id="header" class="clear">
<?php if ($traction->logoState() == 'true' ) : ?>
<div class="logo logo-img">
<a href="<?php bloginfo( 'url' ); ?>"><img
src="<?php bloginfo( 'stylesheet_directory' ); ?>/images/<?php echo
$traction->logoName(); ?>" alt="<?php if ($traction->logoAlt() !== '' ) echo
$traction->logoAlt(); else echo bloginfo( 'name' ); ?>"/></a>
<?php if ($traction->logoTagline() == 'true' ) { ?>
<div id="description">
<?php bloginfo( 'description' ); ?>
</div><!--end description-->
<?php } ?>
</div><!--end logo-->
<?php else : ?>
<div class="logo">
<?php if (is_home()) echo( '<h1 id="title">' );
else echo( '<div id="title">' );?><a href="<?php bloginfo( 'url' ); ?>"><?php
bloginfo( 'name' ); ?></a><?php if (is_home()) echo( '</h1>' ); else echo( '</div>'
);?>
<div id="description">
<?php bloginfo( 'description' ); ?>
</div><!--end description-->
</div><!--end logo-->
<?php endif; ?>
<?php if ($traction->bannerState() != '' ) { ?>
<div class="banner">
<a href="<?php if ($traction->bannerUrl() != '' )
echo $traction->bannerUrl(); else echo "#"; ?>"><img class="alignleft" src="<?php
bloginfo( 'stylesheet_directory' ); ?>/images/ads/<?php if ($traction->bannerImage() !=
'' ) echo $traction->bannerImage(); else echo "468_ad.png"; ?>" width="468"
height="60" alt="<?php if ($traction->bannerAlt() != '' ) echo $traction->bannerAlt();
else echo bloginfo( 'name' ); ?>" /></a>
</div>
<?php } ?>
<div id="cat-nav" class="clear">
<ul class="nav">
<?php if ($traction->hideCategories() != 'true' )
: ?>
<?php wp_list_categories( 'title_li=&
exclude=' . $traction->excludedCategories()); ?>
<?php endif; ?>
</ul>
</div><!--end cat-nav-->
</div><!--end header-->
<?php if (($traction->sliderState() != '' ) && is_front_page() &&
!is_paged() ) { ?>
<?php if (is_file(STYLESHEETPATH . '/featured.php' ))
include(STYLESHEETPATH . '/featured.php' ); else include(TEMPLATEPATH . '/featured.php'
); ?>
<?php } ?>
If you want metatags for every post/page just take out metas for description and keywords of the global condition is_front_page. Your code for head section regarding to metatags could be as follows (look at the comments for each type metatag):
<!-- Title -->
<?php if ( is_front_page() ) : ?>
<title><?php bloginfo( 'name' ); ?></title>
<?php elseif ( is_404() ) : ?>
<title><?php _e( 'Page Not Found |', 'traction' ); ?> | <?php bloginfo( 'name' );
?></title>
<?php elseif ( is_search() ) : ?>
<title><?php printf(__ ("Search results for '%s'", "traction"),
attribute_escape(get_search_query())); ?> | <?php bloginfo( 'name' ); ?></title>
<?php else : ?>
<title><?php wp_title($sep = '' ); ?> | <?php bloginfo( 'name' );?></title>
<?php endif; ?>
<!-- Description / Keywords -->
<meta name="description" content="<?php if ( is_single() ) {
single_post_title('', true);
} else {
bloginfo('name'); echo " - "; bloginfo('description');
}
?>" />
<meta name="keywords" content="mediafire, free movies, download movies, movies
mediafire, online movies, download mediafire movies, movies online, hindi movies,
bollywood movies, english movies, small movies, high quality, small size, free
download, download, download links" />
<meta http-equiv="author" content="M.Naeem Riaz" />
<!-- Basic Meta Data -->
<meta name="Copyright" content="Design is copyright <?php echo date( 'Y' ); ?> The
Theme Foundry" />
<meta http-equiv="imagetoolbar" content="no" />
<meta http-equiv="Content-Type" content="<?php bloginfo( 'html_type' ); ?>;
charset=<?php bloginfo( 'charset' ); ?>" />
<?php if ((is_single() || is_category() || is_page() || is_home()) && (!is_paged())) :
else : ?>
<meta name="robots" content="noindex,follow" />
My wordpress*(a custom template)* nav is all working on all of the pages but now I found out that the Main nav doesn't show on this pages
All pages e.g. search.php, single.php, index.php, page.php all has <?php get_header(); ?>
I really don't know whats wrong.
Here is the code for my header.php
<?php
/**
* #package WordPress
* #subpackage Default_Theme
*/
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" <?php language_attributes() ?>>
<head>
<meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php bloginfo('charset'); ?>" />
<title><?php bloginfo('name'); ?> <?php wp_title(); ?></title>
<link rel="stylesheet" href="<?php bloginfo('stylesheet_url'); ?>" type="text/css" media="screen,projection" />
<link rel="stylesheet" href="<?php bloginfo('template_url'); ?>/css/sifr.css" type="text/css" />
<script src="<?php bloginfo('template_url'); ?>/js/sifr.js" type="text/javascript"></script>
<script src="<?php bloginfo('template_url'); ?>/js/sifr-config.js" type="text/javascript"></script>
<script src="http://cdn.jquerytools.org/1.1.2/jquery.tools.min.js"></script>
<?php wp_head(); ?>
</head>
<?php
$current_page = $post->ID;
$parent = 1;
while($parent) {
$page_query = $wpdb->get_row("SELECT post_name, post_parent FROM $wpdb->posts WHERE ID = '$current_page'");
$parent = $current_page = $page_query->post_parent;
if(!$parent) $parent_name = $page_query->post_name;
}
?>
<body id="<?php echo (is_page()) ? "$parent_name" : ((is_home()) ? "blog" : ((is_search()) ? "other" : ((is_single()) ? "blog" : "blog"))); ?>">
<div id="BGtie">
<!--HEAD WRAPPER-->
<div id="headwrapper">
<!--HEADER-->
<div id="headContainer">
<div id="nameTag">
<?php bloginfo('name'); ?>
</div>
<!--TOP NAV-->
<div id="topNav">
<ul>
<li>Home</li>
<li>Request info</li>
<li>Contact us</li>
<?php do_action('icl_language_selector'); ?>
</ul>
</div>
<!--END TOP NAV-->
<!--MAIN NAV-->
<?php if ( is_page() AND (strtolower(ICL_LANGUAGE_CODE) == 'fr') ) {include("main-nav-fr.php");} ?>
<?php if (is_page() AND (strtolower(ICL_LANGUAGE_CODE) == 'en')) include("main-nav-en.php") ?>
<!--END MAIN NAV-->
</div>
<!--END HEADER-->
</div>
<!--END HEAD WRAPPER-->
</div>
<!--MAIN NAV-->
<?php if ( is_page() AND (strtolower(ICL_LANGUAGE_CODE) == 'fr') ) {include("main-nav-fr.php");} ?>
<?php if (is_page() AND (strtolower(ICL_LANGUAGE_CODE) == 'en')) include("main-nav-en.php") ?>
<!--END MAIN NAV-->
is_page() returns false when in blog post. Remove the is_page and you should be fine.
Further reading - http://codex.wordpress.org/Conditional_Tags