This question already has answers here:
Reference - What does this error mean in PHP?
(38 answers)
Closed 8 years ago.
I get the following error when I open the index page:
Parse error: syntax error, unexpected $end in C:\xampp\htdocs\... on
line 161
Here is the code:
<!DOCTYPE html>
<html <?php language_attributes(); ?>>
<head>
<title>
<?php
/*
* Print the <title> tag based on what is being viewed.
*/
global $page, $paged;
wp_title( '|', true, 'right' );
// Add the blog name.
bloginfo( 'name' );
// Add the blog description for the home / front page.
$site_description = get_bloginfo( 'description', 'display' );
if( $site_description && ( is_home() || is_front_page() ) )
echo " | $site_description";
// Add a page number if necessary:
if( $paged >= 2 || $page >= 2 )
echo ' | ' . sprintf( __( 'Page %s', 'bootstrapwp' ), max( $paged, $page ) );
?>
</title>
<meta charset="<?php bloginfo( 'charset' ); ?>" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<?php
if( is_singular() && get_option( 'thread_comments' ) ) wp_enqueue_script( 'comment-reply' ); ?>
<link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>" />
<!-- Le fav and touch icons -->
<link rel="shortcut icon" href="icon.jpg">
<link rel="apple-touch-icon-precomposed" sizes="144x144" href="<?php bloginfo( 'template_url' );?>/ico/apple-touch-icon-144-precomposed.png">
<link rel="apple-touch-icon-precomposed" sizes="114x114" href="<?php bloginfo( 'template_url' );?>/ico/apple-touch-icon-114-precomposed.png">
<link rel="apple-touch-icon-precomposed" sizes="72x72" href="<?php bloginfo( 'template_url' );?>/ico/apple-touch-icon-72-precomposed.png">
<link rel="apple-touch-icon-precomposed" href="<?php bloginfo( 'template_url' );?>/ico/apple-touch-icon-57-precomposed.png">
<!--[if lt IE 9]>
<script src="//html5shim.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<?php wp_head(); ?>
<?php include 'storeclass.php'; ?>
<style>
.navbar .nav li a
{
padding-right: 0px !important;
}
</style>
<?php
if( function_exists( 'teboAnalytic' ) ){
teboAnalytic();
}
?>
</head>
<?php
if($detect->isMobile() AND !$detect->isTablet()){
?>
<style>
.container
{
max-width: 300px;
}
</style>
<body style="background-color: #E7EBF2;padding-top:65px;" <?php body_class(); ?> data-spy="scroll" data-target=".bs-docs-sidebar" data-offset="10">
<?php
}
else
{
?>
<body style="background-color: #E7EBF2;padding-top:45px;" <?php body_class(); ?> data-spy="scroll" data-target=".bs-docs-sidebar" data-offset="10">
<?php
} ?>
<div class="navbar navbar-inverse navbar-fixed-top">
<div class="navbar-inner">
<div class="container" style="width:940px;">
<ul class="nav">
<li class="hidden-phone">
<img src="<?php echo BASE_URL.'weblogo.png'; ?>" style="width:270px;">
</li>
<?php
if($detect->isMobile() AND !$detect->isTablet()){
?>
<li class="dropdown" style="margin-left:15px;">
<?php
}
else
{
?>
<li class="dropdown offset2">
<?php
} ?>
<a href="#" class="dropdown-toggle" data-toggle="dropdown" style="padding:0;">
<img src="<?php echo BASE_URL; ?>callus.png" style="height:46px;width:203px">
</a>
<?php
if($detect->isMobile() AND !$detect->isTablet()){
callUsBanner('mobile');
}
else
{
callUsBanner('desktop');
}
?>
</li><!-- Regular Menu Ends -->
<li class="divider-vertical">
</li>
</ul>
</div>
</div>
</div>
<?php
if($detect->isMobile() AND !$detect->isTablet()){
?>
<link rel="stylesheet" href="mobile-custom.css" />
<style>
.hhd
{
display: inline-block;
height: 5px;
width: 100%;
}
</style>
<?php
} ?>
<div class="container hhd" style="height:41px;">
<?php
if($detect->isMobile() AND !$detect->isTablet()){
?>
<img src="weblogo.png" style="width:270px;">
<div class="row">
<div class="styled-select blue semi-square divsel span12">
<?php menu1(); ?>
</div>
</div>
<?
} ?>
<div class="subnavbar navbar navbar hidden-phone">
<div class="navbar-inner subnav">
<div class="container">
<button type="button" class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
<span class="icon-bar">
</span>
<span class="icon-bar">
</span>
<span class="icon-bar">
</span>
</button>
<ul class="nav" style="font-size:13px;">
<li class="hidden-phone">
<img src="badge.jpg" style="width:40px;">
</li>
<li class="hidden-phone">
<a href="" style="padding-right: 5px;">
<i class="icon-home">
</i>Home
</a>
</li>
<li class="hidden-phone">
<a href="">
<i class=" icon-th-large">
</i>Store
</a>
</li>
<li class="hidden-phone">
<a href="">
<i class=" icon-tag">
</i>Bursa
</a>
</li>
<li class="divider-vertical subnav">
</li>
<?php menuIjo('desktop','top'); ?>
</ul>
</div>
</div>
</div>
</div>
<script>
$('.renav').click(function(e)
{
//alert('ha');
$('section.dropdown-menu *').removeAttr('data-toggle');
});
</script>
<!-- End Header -->
<!-- Begin Template Content -->
could you help me to solve this problem?
thanks
replace
<? with <?php on line number 132 ( <? } ?> to <?php } ?>
the correct code will be
<!DOCTYPE html>
<html <?php language_attributes(); ?>>
<head>
<title><?php
/*
* Print the <title> tag based on what is being viewed.
*/
global $page, $paged;
wp_title( '|', true, 'right' );
// Add the blog name.
bloginfo( 'name' );
// Add the blog description for the home/front page.
$site_description = get_bloginfo( 'description', 'display' );
if ( $site_description && ( is_home() || is_front_page() ) )
echo " | $site_description";
// Add a page number if necessary:
if ( $paged >= 2 || $page >= 2 )
echo ' | ' . sprintf( __( 'Page %s', 'bootstrapwp' ), max( $paged, $page ) );
?></title>
<meta charset="<?php bloginfo( 'charset' ); ?>" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<?php if ( is_singular() && get_option( 'thread_comments' ) ) wp_enqueue_script( 'comment-reply' ); ?>
<link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>" />
<!-- Le fav and touch icons -->
<link rel="shortcut icon" href="icon.jpg">
<link rel="apple-touch-icon-precomposed" sizes="144x144" href="<?php bloginfo( 'template_url' );?>/ico/apple-touch-icon-144-precomposed.png">
<link rel="apple-touch-icon-precomposed" sizes="114x114" href="<?php bloginfo( 'template_url' );?>/ico/apple-touch-icon-114-precomposed.png">
<link rel="apple-touch-icon-precomposed" sizes="72x72" href="<?php bloginfo( 'template_url' );?>/ico/apple-touch-icon-72-precomposed.png">
<link rel="apple-touch-icon-precomposed" href="<?php bloginfo( 'template_url' );?>/ico/apple-touch-icon-57-precomposed.png">
<!--[if lt IE 9]>
<script src="//html5shim.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<?php wp_head(); ?>
<?php include 'storeclass.php'; ?>
<style>
.navbar .nav li a{
padding-right: 0px !important;
}
</style>
<?php
if ( function_exists( 'teboAnalytic' ) ) {
teboAnalytic();
}
?>
</head>
<?php if ($detect->isMobile() AND !$detect->isTablet()) {?>
<style>
.container{
max-width:300px;
}
</style>
<body style="background-color: #E7EBF2;padding-top:65px;" <?php body_class(); ?> data-spy="scroll" data-target=".bs-docs-sidebar" data-offset="10">
<?php }else{?>
<body style="background-color: #E7EBF2;padding-top:45px;" <?php body_class(); ?> data-spy="scroll" data-target=".bs-docs-sidebar" data-offset="10">
<?php } ?>
<div class="navbar navbar-inverse navbar-fixed-top">
<div class="navbar-inner">
<div class="container" style="width:940px;">
<ul class="nav">
<li class="hidden-phone">
<img src="<?php echo BASE_URL.'weblogo.png'; ?>" style="width:270px;">
</li>
<?php if ($detect->isMobile() AND !$detect->isTablet()) {?>
<li class="dropdown" style="margin-left:15px;">
<?php }else{ ?>
<li class="dropdown offset2">
<?php } ?>
<img src="<?php echo BASE_URL; ?>callus.png" style="height:46px;width:203px">
<?php if ($detect->isMobile() AND !$detect->isTablet()) {
callUsBanner('mobile');
}else{
callUsBanner('desktop');
}
?>
</li><!-- Regular Menu Ends -->
<li class="divider-vertical"></li>
</ul>
</div>
</div>
</div>
<?php if ($detect->isMobile() AND !$detect->isTablet()) {?>
<link rel="stylesheet" href="mobile-custom.css" />
<style>
.hhd{
display:inline-block;
height:5px;
width:100%;
}
</style>
<?php } ?>
<div class="container hhd" style="height:41px;">
<?php if ($detect->isMobile() AND !$detect->isTablet()) {?>
<img src="weblogo.png" style="width:270px;">
<div class="row">
<div class="styled-select blue semi-square divsel span12">
<?php menu1(); ?>
</div>
</div>
<?php } ?>
<div class="subnavbar navbar navbar hidden-phone">
<div class="navbar-inner subnav">
<div class="container">
<button type="button" class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<ul class="nav" style="font-size:13px;">
<li class="hidden-phone"><img src="badge.jpg" style="width:40px;"></li>
<li class="hidden-phone"><i class="icon-home"></i>Home</li>
<li class="hidden-phone"><i class=" icon-th-large"></i>Store</li>
<li class="hidden-phone"><i class=" icon-tag"></i>Bursa</li>
<li class="divider-vertical subnav"></li>
<?php menuIjo('desktop','top'); ?>
</ul>
</div>
</div>
</div>
</div>
<script>
$('.renav').click(function(e){
//alert('ha');
$('section.dropdown-menu *').removeAttr('data-toggle');
});
</script>
<!-- End Header -->
<!-- Begin Template Content -->
Related
I need help trying to figure out how to get a button removed if a user is on the profile page, or if they are on the page, the button could display as a current menu item only it is not clickable.
Here is my code:
<!DOCTYPE html>
<html <?php language_attributes(); ?>>
<head>
<meta charset="<?php bloginfo('charset'); ?>">
<meta name="viewport" content="width=device-width, initial-scale=1">
<?php wp_head(); ?>
</head>
<body <?php body_class(); ?>>
<header class="site-header">
<div class="container">
<h1 class="school-logo-text float-left"><strong>Direct</strong> Connection</h1>
<?php if(is_user_logged_in()) {
?>
<i class="fa fa-search" aria-hidden="true"></i>
<i class="site-header__menu-trigger fa fa-bars" aria-hidden="true"></i>
<div class="site-header__menu group">
<nav class="main-navigation">
<ul>
<li <?php if (get_post_type() == 'event' OR is_page('past-events')) echo 'class="current-menu-item"';
?>>Events</li>
<li <?php if (get_post_type() == 'post') echo "class='current-menu-item'"
?>>Blogs</li>
</ul>
</nav>
<?php } ?>
<div class="site-header__util">
<?php if(is_user_logged_in()) { ?>
<a href="<?php if (is_page() == 'profile') //Needs a function here ?>" class="btn
btn--small btn--dark-orange float-left push-right">View Profile</a>
<a href="<?php echo wp_logout_url(); ?>" class="btn
btn--small btn--orange float-left push-right btn--with-photo">
<span class="site-header__avatar"><?php
echo get_avatar(get_current_user_id(), 60); ?></span>
<span class="btn__text">Log Out</span>
</a>
<?php } else{ ?>
Login
<?php }?>
<?php if(is_user_logged_in()) {
?>
<span href="<?php echo esc_url(site_url('/search')); ?>" class="search-trigger js-search-trigger"><i class="fa fa-search" aria-hidden="true"></i></span>
<?php } ?>
</div>
</div>
</div>
</header>
To hide the button when on a specific page you can add the following code to your functions.php file.
function hide_button_on_page_4() {
if ( is_page ( 4 ) ) {
echo '<style>
.btn.btn--small.btn--dark-orange.float-left.push-right {
display: none;
}
</style>';
}
}
add_action( 'wp_head', 'hide_button_on_page_4' );
In the code above I hide the button when on the page that has 4 as its ID. You can modify is_page(4) with your corresponding page ID.
You can find the page ID in the URL of the page when you are in the editor. For example, if the URL of the page is http://website.com/wp-admin/post.php?post=123&action=edit, the page ID is 123.
I have a strange message in header in Wordpress. It belows on my navigation bar in the wordpress. I do not know how to fix the code. Help people, please..
I have installed plugins but nothing new. The problem has occurred today.
At first I thought I had a syntax error but I tested the code and it is ok.
For example:
enter image description here
Whether the problem is in any other file?
How can i remove this? May be I have an error in header.php...I dont know.
That is my header.php file:
<!doctype html>
<!--[if IE 7 ]> <html <?php language_attributes(); ?> class="isie ie7 oldie no-js"> <![endif]-->
<!--[if IE 8 ]> <html <?php language_attributes(); ?> class="isie ie8 oldie no-js"> <![endif]-->
<!--[if IE 9 ]> <html <?php language_attributes(); ?> class="isie ie9 no-js"> <![endif]-->
<!--[if (gt IE 9)|!(IE)]><!--> <html <?php language_attributes(); ?> class="no-js"> <!--<![endif]-->
<head>
<!-- Google Tag Manager -->
<script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
})(window,document,'script','dataLayer','GTM-W5FZJCF');</script>
<!-- End Google Tag Manager -->
<meta charset="<?php bloginfo( 'charset' ); ?>" />
<?php is_dt_theme_moible_view(); ?>
<script charset="UTF-8" src="//cdn.sendpulse.com/28edd3380a1c17cf65b137fe96516659/js/push/c62b1197420513c7a9c7298ef1e2bb6e_1.js" async></script>
<meta name="author" content="designthemes">
<title><?php dt_theme_public_title(); ?></title>
<link rel="alternate" type="application/rss+xml" title="RSS 2.0" href="<?php bloginfo('rss2_url'); ?>" />
<link rel="profile" href="http://gmpg.org/xfn/11" />
<link rel="pingback" href="<?php bloginfo('pingback_url'); ?>" />
<?php
global $dt_allowed_html_tags;
#Load Theme Styles...
if(dt_theme_option('integration', 'enable-header-code') != '') echo '<script type="text/javascript">'.wp_kses(stripslashes(dt_theme_option('integration', 'header-code')), $dt_allowed_html_tags).'</script>';
wp_head(); ?>
</head>
<body <!-- Google Tag Manager (noscript) -->
<noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-W5FZJCF"
height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
<!-- End Google Tag Manager (noscript) --> <?php if(dt_theme_option("appearance","layout") == "boxed") body_class('boxed'); else body_class(); ?>
<?php if(dt_theme_option('general','loading-bar') != "true") echo '<div id="loader-wrapper"><div class="loader"><span class="fa fa-spinner fa-spin"></span></div></div>'; ?>
<!-- **Wrapper** -->
<div class="wrapper">
<div class="inner-wrapper">
<!-- header-wrapper starts here -->
<?php $htype = dt_theme_option('appearance','header_type'); $htype = !empty($htype) ? $htype : 'header1'; ?>
<div id="header-wrapper" class="<?php if(dt_theme_option('general','header-top-bar') == "true") echo esc_attr('notop-bar'); if($htype == 'header3') echo esc_attr(' header3-wrapper'); ?>">
<header id="header" class="<?php echo esc_attr($htype); ?>">
<?php if(dt_theme_option('general','header-top-bar') != "true"): ?>
<!-- Top bar starts here -->
<div class="top-bar">
<div class="container">
<?php if(dt_theme_option('general', 'top-bar-left-content') != NULL && $htype != 'header5'): ?>
<div class="dt-sc-contact-info">
<p><?php echo wp_kses(do_shortcode(stripslashes(dt_theme_option('general', 'top-bar-left-content'))), $dt_allowed_html_tags); ?></p>
</div>
<?php elseif($htype == 'header5'):
echo do_shortcode('[dt_social/]');
endif; ?>
<div class="top-right">
<ul><?php
if(function_exists("is_woocommerce")): ?>
<li><span class="fa fa-shopping-cart"></span><?php echo sprintf (_n( '%d item', '%d items', WC()->cart->cart_contents_count ), WC()->cart->cart_contents_count ); ?> - <?php echo WC()->cart->get_cart_total(); ?></li><?php
endif;
if(!is_user_logged_in()):
$loginurl = ( class_exists('c_ws_plugin__s2member_check_activation') ) ? wp_login_url() : wp_login_url(get_permalink()); ?>
<li><a title="<?php _e('Login', 'iamd_text_domain'); ?>" href="<?php echo $loginurl; ?>"><span class="fa fa-sign-in"></span><?php _e('Member Login', 'iamd_text_domain'); ?></a></li>
<li><a title="<?php _e('Register Now', 'iamd_text_domain'); ?>" href="<?php echo wp_registration_url(); ?>"><span class="fa fa-user"></span><?php _e('Register', 'iamd_text_domain'); ?></a></li><?php
else: ?>
<li><a title="<?php _e('Logout', 'iamd_text_domain'); ?>" href="<?php echo wp_logout_url(get_permalink()); ?>"><span class="fa fa-sign-out"></span><?php _e('Logout', 'iamd_text_domain'); ?></a></li>
<li><a title="<?php _e('My Profile', 'iamd_text_domain'); ?>" href="<?php
$current_user = wp_get_current_user();
echo get_edit_user_link($current_user->ID); ?>"><span class="fa fa-dashboard"></span><?php _e('My Profile', 'iamd_text_domain'); ?></a></li><?php
endif; ?>
</ul>
</div>
</div>
</div>
<!-- Top bar ends here -->
<?php endif;
if($htype == 'header3'): ?>
<div id="logo"><?php
if( dt_theme_option('general', 'logo') ):
$template_uri = get_template_directory_uri();
$url = dt_theme_option('general', 'logo-url');
$url = !empty( $url ) ? $url : $template_uri."/images/logo.png";
$retina_url = dt_theme_option('general','retina-logo-url');
$retina_url = !empty($retina_url) ? $retina_url : $template_uri."/images/logo#2x.png";
$width = dt_theme_option('general','retina-logo-width');
$width = !empty($width) ? $width."px;" : "187px";
$height = dt_theme_option('general','retina-logo-height');
$height = !empty($height) ? $height."px;" : "49px";?>
<a href="<?php echo esc_url(home_url());?>" title="<?php bloginfo('title'); ?>">
<img class="normal_logo" src="<?php echo esc_url($url);?>" alt="<?php bloginfo('title'); ?>" title="<?php bloginfo('title'); ?>" />
<img class="retina_logo" src="<?php echo esc_url($retina_url);?>" alt="<?php bloginfo('title'); ?>" title="<?php bloginfo('title'); ?>" style="width:<?php echo esc_attr($width);?>; height:<?php echo esc_attr($height);?>;"/>
</a><?php
else: ?>
<div class="logo-title">
<h1 id="site-title"><?php bloginfo('title'); ?></h1>
<h2 id="site-description"><?php bloginfo('description'); ?></h2>
</div><?php
endif; ?>
</div>
<div class="main-menu-container">
<div class="main-menu">
<div id="primary-menu">
<div class="dt-menu-toggle" id="dt-menu-toggle"><?php _e('Menu','iamd_text_domain'); ?><span class="dt-menu-toggle-icon"></span></div>
<nav id="main-menu">
<?php wp_nav_menu( array('theme_location' => 'primary-menu', 'container' => false, 'menu_id' => 'menu-main-menu', 'menu_class' => 'menu', 'fallback_cb' => 'dt_theme_default_navigation', 'walker' => new DTFrontEndMenuWalker())); ?>
</nav>
</div>
</div>
</div><?php
else: ?>
<div class="main-menu-container">
<div class="main-menu">
<div id="logo"><?php
if( dt_theme_option('general', 'logo') ):
$template_uri = get_template_directory_uri();
$url = dt_theme_option('general', 'logo-url');
$url = !empty( $url ) ? $url : $template_uri."/images/logo.png";
$retina_url = dt_theme_option('general','retina-logo-url');
$retina_url = !empty($retina_url) ? $retina_url : $template_uri."/images/logo#2x.png";
$width = dt_theme_option('general','retina-logo-width');
$width = !empty($width) ? $width."px;" : "187px";
$height = dt_theme_option('general','retina-logo-height');
$height = !empty($height) ? $height."px;" : "49px";?>
<a href="<?php echo esc_url(home_url());?>" title="<?php bloginfo('title'); ?>">
<img class="normal_logo" src="<?php echo esc_url($url);?>" alt="<?php bloginfo('title'); ?>" title="<?php bloginfo('title'); ?>" />
<img class="retina_logo" src="<?php echo esc_url($retina_url);?>" alt="<?php bloginfo('title'); ?>" title="<?php bloginfo('title'); ?>" style="width:<?php echo esc_attr($width);?>; height:<?php echo esc_attr($height);?>;"/>
</a><?php
else: ?>
<div class="logo-title">
<h1 id="site-title"><?php bloginfo('title'); ?></h1>
<h2 id="site-description"><?php bloginfo('description'); ?></h2>
</div><?php
endif; ?>
</div>
<div id="primary-menu">
<div class="dt-menu-toggle" id="dt-menu-toggle"><?php _e('Menu','iamd_text_domain'); ?><span class="dt-menu-toggle-icon"></span></div>
<nav id="main-menu">
<?php wp_nav_menu( array('theme_location' => 'primary-menu', 'container' => false, 'menu_id' => 'menu-main-menu', 'menu_class' => 'menu', 'fallback_cb' => 'dt_theme_default_navigation', 'walker' => new DTFrontEndMenuWalker())); ?>
</nav>
</div>
</div>
</div><?php
endif; ?>
</header>
</div>
<?php putRevSlider('slider1', 'homepage'); ?>
I turned off all the plugins and that appeared again.
If there is something to show it i will.
Thank you in advance.
You can try inspecting the message element from the Developer Tool of the web browser to see if there is any broken html code. Here is how to do that in Chrome https://developer.chrome.com/devtools
I tried to add an image (137×30) next to the search bar, but I cannot do it properly. It is supposed to look like this:
The code for search bar is like this:
<?php get_search_form(); ?>
Adding the image gave me this result:
How do I make this image align properly?
The code for this webpage as reference if you need to look at it:
<!doctype html>
<!--[if lt IE 7 ]><html lang="en" class="no-js ie6"> <![endif]-->
<!--[if IE 7 ]><html lang="en" class="no-js ie7"> <![endif]-->
<!--[if IE 8 ]><html lang="en" class="no-js ie8"> <![endif]-->
<!--[if IE 9 ]><html lang="en" class="no-js ie9"> <![endif]-->
<!--[if (gt IE 9)|!(IE)]><!-->
<html <?php language_attributes(); ?> class="no-js">
<!--<![endif]-->
<head>
<meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php bloginfo('charset'); ?>" />
<title><?php wp_title( '-', true, 'right' ); ?></title>
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">
<link rel="apple-touch-icon" href="<?php echo get_template_directory_uri(); ?>/apple-touch-icon.png">
<link rel="icon" type="image/png" href="<?php echo get_template_directory_uri(); ?>/favicon.ico">
<link rel="shortcut icon" type="image/x-icon" href="<?php echo get_template_directory_uri(); ?>/favicon.ico">
<!--[if lt IE 9]>
<script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.6.2/html5shiv.js"></script>
<script src="//s3.amazonaws.com/nwapi/nwmatcher/nwmatcher-1.2.5-min.js"></script>
<script src="//html5base.googlecode.com/svn-history/r38/trunk/js/selectivizr-1.0.3b.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/respond.js/1.1.0/respond.min.js"></script>
<link rel="stylesheet" href="<?php echo get_template_directory_uri(); ?>/css/ie8.css">
<![endif]-->
<script type="text/javascript">
!function(){function t(){var t=r("utm_content");if(t){var e=new Date;e.setDate(e.getDate()+30),document.cookie=t+";expires="+e.toGMTString()+";path=/"}else if(document.cookie)for(var o=document.cookie.split(/; */),n=0;n<o.length;n++)if(0===o[n].toLowerCase().trim().indexOf("utm_content=")){t=o[n];break}return t}function e(t){try{console.log(t)}catch(e){alert(t)}}function r(t){var e=top.location.search?top.location.search.substring(1):null;if(e)for(var r=e.split("&"),o=0;o<r.length;o++)if(0===r[o].toLowerCase().trim().indexOf(t+"="))return r[o];return null}var o="",n=r("mctest");if(n)e("dnr tag version: 20160125"),o="http://localhost:8080/rip/library/dnr/mcDnrTag.debug.js";else{var a=t(),c="";a&&(c=top.location.search?0<=top.location.search.indexOf("utm_content")?top.location.search:top.location.search+"&"+a:"?"+a,o="https://script.advertiserreports.com/redirector/dnr"+c)}if(o){var i=document.createElement("script");i.src=o,i.type="text/javascript",scriptTag=document.getElementsByTagName("script")[0],scriptTag.parentNode.appendChild(i)}}();
</script>
<?php
wp_head();
if(function_exists('ot_get_option'))
echo ot_get_option( 'cnkt_google_analytics' );
?>
</head>
<body <?php body_class(); ?>>
<?php
$cats = '';
foreach(get_the_category() as $category)
$cats .= $category->slug . ' ';
?>
<div id="container" class="<?php echo $post->post_name; echo ' '. $cats; ?>">
Skip to main content
<div id="wrapper">
<header class="site-header" role="banner">
<div class="row">
<div class="large-12 columns">
<ul class="secondary hide-for-medium-down">
<li class="mailinglist">Join our Mailing List</li>
<li class="quote">Request a Quote</li>
</ul>
<div class="nav-wrap">
<div class="logo">
<img src="<?php echo get_template_directory_uri(); ?>/img/logo.png" />
</div>
<div class="sub-wrap hide-for-medium-down">
<nav id="utilitynav" role="navigation">
<ul id="menu-utility" class="menu">
<li id="menu-item-2398" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-2398 menu-item-news">
News & Events
</li>
<li id="menu-item-2397" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-2397 menu-item-contact-us">
Contact Us
</li>
<li class="linkedin">
<a href="https://www.linkedin.com/company/shaver-industries-inc<?php echo '-' ?>" target="_blank">
<em class="fa fa-linkedin-square"></em>
<span class="offscreen">LinkedIn</span>
</a>
</li>
<li class="twitter">
<a href="https://twitter.com/shaver_inc" target="_blank">
<em class="fa fa-twitter"></em>
<span class="offscreen">Twitter</span>
</a>
</li>
<li class="facebook">
<a href="https://www.facebook.com/ShaverIndustriesInc?fref=ts" target="_blank">
<em class="fa fa-facebook"></em>
<span class="offscreen">Facebook</span>
</a>
</li>
<li class="youtube">
<a href="https://www.youtube.com/channel/UC6zDe4BG-OAuV4_JLrmu-JA" target="_blank">
<em class="fa fa-youtube"></em>
<span class="offscreen">YouTube</span>
</a>
</li>
</ul>
<?php /*if ( has_nav_menu('utility-menu')):?>
<?php wp_nav_menu( array( 'theme_location' => 'utility-menu', 'container'=>'' ) );
dynamic_sidebar('social-media'); ?>
<?php endif;*/ ?>
<?php
if ( function_exists( 'ot_get_option' ) ) {
if (ot_get_option('cnkt_phone')) {
echo '<span class="number">'.ot_get_option('cnkt_phone').'</span>';
}
}
?>
</nav>
<?php get_search_form(); ?>
</div>
</div>
<nav id="mnav" class="hide-for-medium-down" role="navigation">
<?php if ( has_nav_menu('primary-menu')):?>
<?php wp_nav_menu( array( 'theme_location' => 'primary-menu', 'container'=>'' ) ); ?>
<?php endif; ?>
</nav>
</div>
</div>
<div id="mnav-toggle" class="nav-toggle hide-for-medium-up" aria-hidden="true">
<a href="javascript:void(0);">
<span class="one"></span>
<span class="two"></span>
<span class="three"></span>
</a>
</div>
</header>
<div id="mobile-nav"><div class="wrap"></div></div>
<?php if(!is_page('home')){
get_template_part('includes/page-banner');
} ?>
<!-- #page-content -->
<div id="page-content">
Add an ID outside of your input and img and add below css. Demo example added like this. See at fiddle http://jsfiddle.net/wD5T9/
HTML
<div id='searchWrapper'>
<input id='searchBox' style='width:250px; border:1px solid #cccccc; border-radius:7px 7px 7px 7px; padding:5px 28px 5px 10px; margin-top:14px; margin-left:50px;height:18px;' type='text' placeholder='Search'/>
<img src='http://www.q-park.ie/Portals/8/images/search-icon.png'/>
</div>
CSS
#searchWrapper img {
vertical-align: middle;
}
Here is the solution of your problem....
Your Html
<div class="searchform">
<form method="get" action="http://www.shaverinc.com">
<label for="search" class="offscreen">Search Products</label>
<input type="search" placeholder="Search Products" id="s" name="s" value="">
<button type="submit"><i class="fa fa-search"></i><span class="offscreen">Submit</span></button>
</form>
</div>
<div class="flags">Hello</div>
Your CSS Here.....
.searchform {
position: relative;
overflow: hidden;
height: 34px;
width: 90%;
display: inline-block;
float: left;
}
.flags{
display: block;
width: 9%;
height: 34px;
position: relative;
float: left;
background: #ccc;
}
Manipulate the width according to your need...
I figure it out by myself, I should use div+table to figure this out
<div style="position: relative; width: 600px;">
<table style="width: 100%">
<tr>
<td width="80%"><?php get_search_form(); ?></td>
<td width="20%"><img src="<?php echo get_template_directory_uri(); ?>/img/flags.png"></td>
</tr>
</table>
</div>
Here is my website:
drawyourpets.com
I followed the tutorial here: http://www.internetkultur.at/simple-hamburger-drop-down-menu-with-css-and-jquery/, but unfortunately my hamburger menu is always visible (it's only supposed to be visisble from 0-780px) and it doesn't work.
I copied and pasted the code from the HTML section into header.php. The code from the tutorial starts with div class="mobile nav" and ends with it's respective div. I also added
<script src="javascript.js"></script>
to link header.php to the javascript code from the tutorial. Javascript.js was uploaded to the child theme.
<?php
/** * Header template * * #package Portfolio Press */?>
<!DOCTYPE html>
<html <?php language_attributes(); ?>>
<head>
<meta charset="<?php bloginfo( 'charset' ); ?>">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="profile" href="http://gmpg.org/xfn/11">
<link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>">
<script src="javascript.js"></script>
<!--[if lt IE 9]>
<script src="<?php echo esc_url( get_template_directory_uri() .
'/js/html5.js' ); ?>">
</script><![endif]-->
<?php wp_head(); ?></head><body <?php body_class(); ?>><div id="page">
<header id="branding">
<div class="col-width">
<?php $heading_tag = ( is_home() || is_front_page() ) ? 'h1' : 'div'; ?
>
<div class="logo">
<a href="<?php echo esc_url( home_url( '/' ) );
?>
"rel="home">
<img src="<?php echo esc_url( portfoliopress_get_option( 'logo' ) ); ?
>" alt="<?php echo bloginfo( 'name' ) ?>">
</a>
</div>
<div class="site-description">
<h1 id="pets">DRAW YOUR PETS</h1>
<h3 id="italic">-The Creative Side-
</h2>
</div>
<div class="clear clearfix">
</div>
<div class="site-navigation primary-navigation" role="navigation">
<div class="mobile-nav">
<div class="menu-btn" id="menu-btn">
<div></div>
<span></span>
<span></span>
<span></span>
</div>
<div class="responsive-menu">
<ul>
<li><a href="http://drawyourpets.com/">
HOME</a>
</li>
<li>
<a href="http://drawyourpets.
com/index.php/audio/">
AUDIO
</a>
</li>
<li><a href="http://drawyourpets.com/index.php/video-3/">
VIDEO
</a>
</li>
<li>
<a href="http://
drawyourpets.com/index.php/other/">
OTHER</a>
</li>
</ul>
</div>
</div>
<?php wp_nav_menu( array( 'theme_location' => 'primary', 'menu_class'|
=> 'nav-menu' ) ); ?>
</div>
<div id="main">
<div class="site-wrapper">
Besides that, I just added the CSS from the tutorial into my child theme stylesheet with this media query above it:
#media screen and (min-width: 780px) .menu-btn div {
So I'm not sure what I've done wrong or what I need to do to fix it. Let me know if you have any ideas. Thanks!
<script src="javascript.js"></script>
Firstly, the path is wrong; 404;
<script src="<?php bloginfo('template_url'); ?>/js/javascript.js"></script>
bloginfo('template_url'); This is your path of theme, you can upload the javascript.js to the corresponding path
Secondly, the "javascript.js" need "jquery.js"; So you must add this behind "jquery.js"
No, you just include a jQuery files. Add this :
<script src="https://code.jquery.com/jquery-2.2.2.min.js"></script>
above your javascript.js
I am new in WordPress and I have problem with creating WordPress theme.
I've created a simple template (my first template), in the tutorial I read that I should cut all the header content and paste it in the header.php file.
I did this, and pasted all the header from <!Doctype html> to </head> in header.php and when I include header using get_header() WordPress add a link inside a <div id="header" role="banner"> in body and show that to me.
I don't need that link and div, How to get the rid of that?
This is my code:
index.php:
<?php
get_header();
?>
<div id="extra-content">
<div id="extra-left-div">
<h3>Posts</h3>
<?php if(have_posts()): ?>
<?php while ( have_posts() ):the_post(); ?>
<?php the_title(); ?>
<?php endwhile; ?>
<?php endif; ?>
</div>
<div id="extra-tag-div">
<h3>Tags</h3>
<?php the_tags('',''); ?>
</div>
<div id="extra-category-div">
<h3>Categories</h3>
<?php wp_list_categories('title_li=&hierarchical=0&depth=1&title_li=');?>
</div>
</div>
<div id="full-div">
<div id="logo">
<h1><?php bloginfo('name'); ?></h1>
</div>
<?php if ( have_posts() ) : ?>
<ul id="main-content">
<?php while ( have_posts() ) : the_post(); ?>
<li class="post" id="post-<?php the_ID(); ?>">
<h2 class="post-title"><?php the_title(); ?></h2>
<div class="summery-d"><?php the_excerpt(); ?></div>
<div class="post-meta">
<time> <?php the_date(); ?></time>
</div>
</li>
<?php endwhile; ?>
</ul>
<?php endif; ?>
<?php
get_footer();
?>
header.php
<!doctype html>
<html <?php language_attributes(); ?>>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=<?php bloginfo( 'charset' ); ?>">
<script type="text/javascript" src="http://code.jquery.com/jquery-1.11.3.min.js"></script>
<script type="text/javascript" src="<?php bloginfo('template_url'); ?>/first.js"></script>
<title><?php
global $page, $paged;
wp_title( '|', true, 'right' );
bloginfo( 'name' );
$site_description = get_bloginfo( 'description', 'display' );
if ( $site_description && ( is_home() || is_front_page() ) )
echo " | $site_description";
if ( $paged >= 2 || $page >= 2 )
echo ' | ' . sprintf( __( 'Page %s', 'mytheme' ), max( $paged, $page ) );
?></title>
<meta name="description" content="<?php bloginfo('description'); ?>">
<link rel="stylesheet" media="screen" type="text/css" href="<?php bloginfo('stylesheet_url'); ?>" />
<?php if ( is_singular() ) wp_enqueue_script( 'comment-reply' ); ?>
<link rel="alternate" type="appliction/rss+xml" href="<?php bloginfo('rss2_url'); ?>" title="<?php printf(__( 'آخرین مطالب %s', 'mytheme' ), wp_specialchars( get_bloginfo('name'), 1 ) ); ?>" />
<link rel="alternate" type="appliction/rss+xml" href="<?php bloginfo('comments_rss2_url'); ?>" title="<?php printf(__( 'آخرین نظرات %s', 'mytheme' ), wp_specialchars( get_bloginfo('name'), 1 ) ); ?>" />
<link rel="pingback" href="<?php bloginfo('pingback_url'); ?>" />
</head>
<body <?php body_class(); ?>>
<div class="behind" id="b-1">
</div>
<div class="behind" id="b-2">
</div>
<div class="behind" id="b-3">
</div>
<div class="behind" id="b-4">
</div>
<div class="behind" id="b-5">
</div>
<div class="behind" id="b-6">
</div>
<div class="behind" id="b-7">
</div>
<a id="menu-a" href="javascript:void(0);">
</a>
divs with .behind class and #menu-a and some other elements are not in the source (just press ctrl+u), and a link added that I don't need it
<div id="header" role="banner">
<div id="headerimg">
<h1>Mohammad Kermani</h1>
<div class="description"></div>
</div>
</div>
<hr />
I am working on this website
I found the answer
There is not problem, I was named the header.php as headr.php
I just post this answer because maybe one other person has same problem...