I need to make iframe url, for example:
https://url.com/category/{category_name)/t=desktop || /t=mobile.
I'm using MAMP to run my local dev env and i got it working like it should be, when query string is equal to desktop it shows 3 posts and when mobile then only one post. Now the issue is following, when sysadmin is updating pre-live env he can see from logs this error:
[Wed Nov 15 20:09:42.122140 2017] [:error] [pid 7776] [client 10.1.2.66:41696] PHP Parse error: syntax error, unexpected end of file, expecting elseif (T_ELSEIF) or else (T_ELSE) or endif (T_ENDIF) in /var/lib/wordpress/wp-content/themes/wpTheme2/single_iframe.php on line 234
single-iframe.php full code: https://pastebin.com/MBC6thDW
When i'm trying to go test url i'm either getting Error 500 or header with query function just printed out.
I'm using PhpStorm IDE and it doesn't show any errors in my code, what i'm missing here?
It is because of shorttags.
In your localhost environment using "< ?" is enabled, in your development server it is not enabled. That is the only reason.
http://php.net/manual/en/language.basic-syntax.phptags.php
So, just replace "< ?" with "< ?php", and it will work ok.
Try this code
https://pastebin.com/7ubTY2A4
<?php
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
<meta name="description" content="<?php bloginfo('description'); ?>">
<?php
if(get_field('fav_icon', 'option') != ''){
$favId = get_field('fav_icon', 'option');
$favDetails = wp_get_attachment_image_src($favId, 'full');
}
?>
<?php if(!empty($favDetails)): ?>
<link rel="shortcut icon" href="<?php echo $favDetails[0]; ?>">
<?php endif;?>
<title><?php wp_title();?></title>
<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet" integrity="sha384-wvfXpqpZZVQGK6TAh5PVlGOfQNHSoD2xbE+QkPxCAFlNEevoEH3Sl0sibVcOQVnN" crossorigin="anonymous">
<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
<script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
<![endif]-->
<?php wp_head(); ?>
<!--[if (lt IE 9)&(!IEMobile)]>
<link rel="stylesheet" type="text/css" href="enhanced.css" />
<link rel="stylesheet" type="text/css" href="iframe.css" />
<![endif]-->
<?php
if(is_front_page()){
$info = get_bloginfo('description');
echo '<meta name="og:description" content="'.$info.'">';
echo '<meta name="og:title" content="Website">';
}
?>
<style>
.main-header--frame {
background-color: #a40057;
margin-bottom: -40px;
}
.main-header--frame .categoryTitle {
display: inline-block;
padding-top: 19px;
padding-left: 10px;
color: #ffffff;
}
.main-header.main-header--frame .container {
max-width: 1200px;
background-color: transparent;
}
</style>
</head>
<body>
<header class="main-header main-header--frame">
<nav>
<div class="container">
<div class="navbar-header">
<a href="https://stiil.ee" class="navbar-brand">
<img src="logo" alt="logo"
class="img-responsive">
</a>
<h1 class="categoryTitle">Description</h1>
</div>
</div>
</nav>
</header>
<main class="main-content main-content-inner valitud-content-inner">
<div class="container">
<?php
$queried_object = get_queried_object();
$taxChilds = get_terms( array(
'taxonomy' => 'category',
'hide_empty' => true,
'child_of' => $queried_object->term_id
) ); ?>
<?php if(isset($_GET) && $_GET['t'] == 'desktop'): ?>
<div class="category-wrap">
<?php
$queried_object = get_queried_object();
$count =0;
foreach($taxChilds as $taxChild): ?>
<?php
$args = array(
'post_type'=> 'post',
'cat' => $taxChild->slug,
'posts_per_page' => '1',
'orderby' => 'rand',
'tax_query' => array(
array(
'taxonomy' => 'category',
'field' => 'term_id',
'hide_empty' => false,
'terms' => $taxChild->term_id,
),
)
);
query_posts($args); if(have_posts()):
while(have_posts()): the_post(); ?>
<div class="col-md-4 all itemz <?php echo $taxChild->slug; ?>" data-cat="<?php echo $taxChild->slug; ?>">
<div class="item-wrap">
<a href="<?php the_permalink();?>"><?php the_post_thumbnail('size-370x416');
$sponsored = get_field('is_sponsored_content');
if($sponsored){
echo '<div class="sponsored-text">Ad</div>';
};
?></a>
<div class="overlay">
<div class="notify">
<img src="<?php echo get_post_cat_img_src();?>" alt="">
</div>
<h2 class="categoryTitle"><?php the_title(); ?></h2>
</div>
</div>
</div>
<?php endwhile;
endif; wp_reset_query();?>
<?php
if ($count == 2) {
break;
}
?>
<?php $count++; endforeach;?>
</div>
<?php endif; ?>
<?php if(isset($_GET) && $_GET['t'] == 'mobile'): ?>
<div class="category-wrap">
<?php
$queried_object = get_queried_object();
$count =0; foreach($taxChilds as $taxChild): ?>
<?php
$args = array(
'post_type'=> 'post',
'cat' => $taxChild->slug,
'posts_per_page' => '1',
'orderby' => 'rand',
'tax_query' => array(
array(
'taxonomy' => 'category',
'field' => 'term_id',
'hide_empty' => false,
'terms' => $taxChild->term_id,
),
)
);
query_posts($args);
if(have_posts()):
while(have_posts()): the_post(); ?>
<div class="col-md-4 all itemz <?php echo $taxChild->slug; ?>" data-cat="<?php echo $taxChild->slug; ?>">
<div class="item-wrap">
<a href="<?php the_permalink();?>"><?php the_post_thumbnail('size-370x416');
$sponsored = get_field('is_sponsored_content');
if($sponsored){
echo '<div class="sponsored-text">SISUTURUNDUS</div>';
};
?></a>
<div class="overlay">
<div class="notify">
<img src="<?php echo get_post_cat_img_src();?>" alt="">
</div>
<h2 class="categoryTitle"><?php the_title(); ?></h2>
</div>
</div>
</div>
<?php endwhile;
endif; wp_reset_query();?>
<?php
if ($count == 0) {
break;
}
?>
<?php $count++; endforeach;?>
</div>
<?php endif; ?>
</div>
</main>
</body>
<!--main-content ends-->
<?php wp_footer(); ?>
Related
I'm trying to add some contact details to the right of the logo on this site.
At the moment it is displaying beneath the logo. I'd also like to change the font and colour to match the nav bar.
Here's the code for the header.php to show what I did to the site.
I'm also aware that Laura (the owner) should be using a child theme but her husband built the site and has already done a lot of work without a child so building one for this one change seems redundant?
<!DOCTYPE html>
<html <?php language_attributes(); ?> class="no-js" >
<!-- start -->
<head>
<meta charset="<?php bloginfo( 'charset' ); ?>" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />
<meta name="format-detection" content="telephone=no">
<!-- set faviocn-->
<?php
global $pmc_data;
$favicon = '';
if(isset($pmc_data['favicon']))
$favicon = $pmc_data['favicon'];
if (empty($favicon)) { $favicon = get_template_directory_uri() .'/images/favicon.ico'; }
?>
<!-- set title of the page -->
<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' , max( $paged, $page ) );
?>
</title>
<meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php bloginfo('charset'); ?>" />
<link id="favicon" rel="icon" type="image/png" href="<?php echo $pmc_data['favicon'] ?>">
<link rel="alternate" type="application/atom+xml" title="<?php bloginfo('name'); ?> Atom Feed" href="<?php bloginfo('atom_url'); ?>" />
<?php if ( is_singular() && get_option( 'thread_comments' ) ) {wp_enqueue_script( 'comment-reply' ); }?>
<!-- add google analytics code -->
<?php
if(isset($pmc_data['google_analytics']))
echo pmc_stripText($pmc_data['google_analytics']);
?>
<?php wp_head();?>
</head>
<!-- start body -->
<body <?php body_class(); ?>>
<!-- start header -->
<header>
<div id="headerwrap" >
<!-- fixed menu -->
<div class="pagenav fixedmenu">
<div class="holder-fixedmenu">
<div class="logo-fixedmenu">
<?php $logo = $pmc_data['logo']; ?>
<img src="<?php if ($logo != '') {?><?php echo $logo; ?><?php } else {?><?php get_template_directory_uri(); ?>/images/logo.png<?php }?>" alt="<?php bloginfo('name'); ?> - <?php bloginfo('description') ?>" >
</div>
<div class="menu-fixedmenu">
<?php
if ( has_nav_menu( 'scroll_menu' ) ) {
wp_nav_menu( array(
'container' =>false,
'container_class' => 'menu-scroll',
'theme_location' => 'scroll_menu',
'echo' => true,
'fallback_cb' => 'ideo_fallback_menu',
'before' => '',
'after' => '',
'link_before' => '',
'link_after' => '',
'depth' => 0,
'walker' => new description_walker())
);
}
?>
</div>
<!-- respoonsive menu for scrool bar -->
</div>
</div>
<!-- top bar -->
<div class="TopHolder">
<?php pmc_showTop() ?>
</div>
<!-- logo and main menu -->
<div id="header">
<div class = "header-inner">
<div class="header-social">
<?php pmc_socialLink() ?>
</div>
<div id="logo">
<?php $logo = $pmc_data['logo']; ?>
<img src="<?php if ($logo != '') {?><?php echo $logo; ?><?php } else {?><?php get_template_directory_uri(); ?>/images/logo.png<?php }?>" alt="<?php bloginfo('name'); ?> - <?php bloginfo('description') ?>" />
<div id="contact">
<p>07939598489</p> <p>laura#bristolbridalboutique.co.uk</p>
</div>
</div>
<!-- respoonsive menu main-->
<div class="respMenu noscroll">
<div class="resp_menu_button"><i class="fa fa-list fa-2x"></i> Menu</div>
<?php
if ( has_nav_menu( 'resp_menu' ) ) {
$menuParameters = array(
'theme_location' => 'resp_menu',
'walker' => new Walker_Responsive_Menu(),
'echo' => false,
'items_wrap' => '<div class="event-type-selector-dropdown">%3$s</div>',
);
echo strip_tags(wp_nav_menu( $menuParameters ), '<a>,<br>,<div>,<i>' );
}?>
</div>
<!-- main menu -->
<div class="pagenav">
<?php
if ( has_nav_menu( 'main-menu' ) ) {
wp_nav_menu( array(
'container' =>false,
'container_class' => 'menu-header',
'theme_location' => 'main-menu',
'echo' => true,
'fallback_cb' => 'ideo_fallback_menu',
'before' => '',
'after' => '',
'link_before' => '',
'link_after' => '',
'depth' => 0,
'walker' => new description_walker())
);
}
?>
</div>
</div>
</div>
</header>
To get it on the right side you can use
#contact{ float:right;}
and to align it with the rest you can add
margin-top:54px;
for the font/color you can add
font-family: "brioche-italic", georgia, "Helvetica Neue", Arial, Helvetica, Verdana, sans-serif !important;
font-size: 17px;
color: #94bfba !important;
I am a beginner in WP. I want different logo in each page of word press site like for few page of the site i need different logo and different for other. i tried to use conditional statement but as i am beginner so my overall site crashes and have a blank screen. if there is some plugin that can achieve this kind of functionality it would be really a great help.
Can you guide me how to achieve it.
Here is my header.php code i tried to edit it but all in vain.
<html <?php language_attributes(); ?>>
<!--<![endif]-->
<head>
<meta charset="<?php bloginfo( 'charset' ); ?>" />
<meta name="viewport" content="width=device-width" />
<title><?php wp_title( '|', true, 'right' ); ?></title>
<link rel="profile" href="http://gmpg.org/xfn/11" />
<link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>" />
<meta name="viewport" content="initial-scale=1">
<!--[if lt IE 9]>
<script src="<?php echo get_template_directory_uri(); ?>/js/source/vendor/html5.js" type="text/javascript"></script>
<![endif]-->
<?php wp_head(); ?>
</head>
<body <?php body_class(); ?>>
<div id="page" class="hfeed site">
<header id="masthead" class="site-header" role="banner">
<div class="container">
<a href="<?php echo esc_url( home_url( '/' ) ); ?>" title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" rel="home" class="site-branding">
<!--Editing start from here and i am gona delete all other code from above span section-->
<?php $header_image = get_header_image(); ?>
<h1 class="site-title">
<?php if ( ! empty( $header_image ) ) : ?>
<img src="<?php echo $header_image ?>" width="<?php echo get_custom_header()->width; ?>" height="<?php echo get_custom_header()->height; ?>" alt="" />
<?php endif; ?>
<span><?php bloginfo( 'name' ); ?></span>
</h1>
<h2 class="site-description"><?php bloginfo( 'description' ); ?></h2>
</a>
<nav id="site-navigation" class="site-primary-navigation slide-left">
<i class="icon-cancel-circled"></i> <span><?php _e( 'Close', 'jobify' ); ?></span>
<?php get_search_form(); ?>
<?php wp_nav_menu( array( 'theme_location' => 'primary', 'menu_class' => 'nav-menu-primary' ) ); ?>
</nav>
<?php if ( has_nav_menu( 'primary' ) ) : ?>
<i class="icon-menu"></i>
<?php endif; ?>
</div>
</header><!-- #masthead -->
<div id="main" class="site-main">
Thanks
Try using something like this.
if(is_page('Blog')){ // the parameter used here is the post_title
echo '<img src="http://yourwebsite.com/path-to-your-image/blog-logo.png" />';
}elseif(is_page('home')){ // the parameter used here is the post slug
echo '<img src="http://yourwebsite.com/path-to-your-image/home-logo.png" />';
}elseif(is_page('42')){ // the parameter used here is the post id
echo '<img src="http://yourwebsite.com/path-to-your-image/other-logo.png" />';
}else{ // else display default logo
$header_image = get_header_image();
}
You can get more info here:
https://codex.wordpress.org/Function_Reference/is_page
Depending on the theme you are using, it's sometimes build-in feature!
I know Arcade Basic which has this custom header feature:
https://wordpress.org/themes/arcade-basic/
There are probably much more theme's which supports this feature by default, search on the 'featured-image-header' and 'flexible-header' tags on the Wordpress site to find more themes....
https://wordpress.org/themes/tags/featured-image-header/
https://wordpress.org/themes/tags/flexible-header/
And maybe 'custom-header' tag?
https://wordpress.org/themes/tags/custom-header/
Finally, there are indeed a lot of plugins, like "WP Header Images", more can be found here:
https://wordpress.org/plugins/search.php?q=header+image&sort=
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" />