Continued as it would not allow me to post it all in one post...
As mentioned in the previous post, Ideally I would like the advert code to go at the bottom of the header, thus below the menu.
This is the header code:
<?php
/**
* Site wide header
*
* @package Wordpress
* @subpackage Anfield Index
* @author Tim Carr
* @version 1
* @copyright n7 Studios
*/
ob_start();
?>
<!DOCTYPE html>
<html lang="en">
<head>
<!-- Metadata -->
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0;">
<meta name="google-site-verification" content="" />
<!-- Title -->
<title><?php wp_title(''); ?> - <?php bloginfo('name'); ?></title>
<!--[if lt IE 9]>
<script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<![endif]-->
<script src="<?php bloginfo('template_url'); ?>/js/modernizr-1.6.min.js"></script>
<!-- Stylesheets -->
<link rel="stylesheet" type="text/css" href="<?php bloginfo('template_url'); ?>/css/reset.css" />
<link rel="stylesheet" type="text/css" href="<?php bloginfo('template_url'); ?>/css/screen.css" />
<!--[if lt IE 9]><link rel="stylesheet" type="text/css" href="<?php bloginfo('template_url'); ?>/css/ie.css" media="screen" /><![endif]-->
<!-- Icons -->
<link rel="shortcut icon" href="/favicon.ico">
<link rel="apple-touch-icon" href="<?php bloginfo('template_url'); ?>/images/apple/icon-iphone.png" />
<link rel="apple-touch-icon" sizes="72x72" href="<?php bloginfo('template_url'); ?>/images/apple/icon-ipad.png" />
<link rel="apple-touch-icon" sizes="114x114" href="<?php bloginfo('template_url'); ?>/images/apple/icon-iphone4.png" />
<!-- RSS -->
<link rel="alternate" type="application/rss+xml" title="<?php bloginfo('name'); ?> RSS Feed" href="<?php bloginfo('rss2_url'); ?>" />
<link rel="alternate" type="application/atom+xml" title="<?php bloginfo('name'); ?> Atom Feed" href="<?php bloginfo('atom_url'); ?>" />
<link rel="pingback" href="<?php bloginfo('pingback_url'); ?>" />
<?php
wp_head();
global $paywallPro;
?>
</head>
<body>
<div class="container">
<div id="outline">
<header id="header">
<h1><a href="/" title="Home"><?php bloginfo('name'); ?></a></h1>
</header>
<nav id="main-menu">
<?php
echo preg_replace(array(
'/\t/', // remove tabs
'/'.str_replace('//','\/\/', get_bloginfo('url')).'/i', // remove full URL
'/current_page_item\s*/i',
'/current_page_ancestor\s*/i',
'/current_page_parent\s*/i',
'/page_item\s+/i',
'/page-item-\d+\s*/i',
'/children\s*/i',
'/\s*class=["\']["\']/i', // empty classes
'/\s*title="[^"]+"/i', // all titles
'/\s+>/i',
'/div>/i' // change div to nav
),
array(
'',
'',
'active',
'open',
'',
'',
'',
'',
'',
'',
'>',
'nav>'
),
wp_nav_menu(array('container' => '', 'theme_location' => header, 'menu_class' => '', 'echo' => false))
);
?>
</nav>
<header id="strapline">
<ul id="ticker">
<?php
$opts = get_option('ai');
if (is_array($opts['ticker'])) {
foreach ($opts['ticker'] as $key=>$ticker) {
if ($ticker['label'] == '' OR $ticker['heading'] == '') continue;
?>
<li>
<?php if ($ticker['url'] != '') { ?><a href="<?php echo $ticker['url']; ?>" title="Continue Reading <?php echo $ticker['heading']; ?>"><?php } ?>
<span style="background-color: #<?php echo $ticker['labelColour']; ?>"><?php echo $ticker['label']; ?></span>
<?php echo $ticker['heading']; ?>
<?php if ($ticker['url'] != '') { ?></a><?php } ?>
</li>
<?php
}
}
?>
</ul>
<ul id="account-actions">
<?php
if (is_user_logged_in()) {
?>
<li class="user">Logged in as <?php echo $paywallPro->user->user_login; ?></li>
<li class="button"><a href="/account" title="My Account">My Account</a></li>
<li class="button"><a href="<?php echo wp_logout_url(get_bloginfo('url')); ?>" title="Logout">Logout</a></li>
<?php
} else {
?>
<li class="button"><a href="/register" title="Register">Register</a></li>
<li class="button"><a href="/login" title="Sign In">Sign In</a></li>
<?php
}
?>
</ul>
</header>
<div id="main">
Would I just put the advert code below the </header> tag at the bottom?
So it would look like this:
</header>
// Advert
if ($count == 3) {
if (!$paywallPro->user->acl['removeAds']) {
?>
<div class="advert">
<script type="text/javascript"><!--
google_ad_client = "pub-6230056227145824";
/* AnfieldIndex.com Main Site */
google_ad_slot = "3598117926";
google_ad_width = 468;
google_ad_height = 60;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</div>
<div class="advert-notice"><a href="/register">Subscribe Now to remove these adverts.</a></div>
<?php
}
}
?>
<div id="main">
Because everytime I do I get Parse error: syntax error, unexpected '}' in /nfs/c08/h02/mnt/116350/domains/dev.anfieldindex.com/html/wp-content/themes/anfieldindex/header.php on line 286
So I remove the final both the } and get the advert appearing below the header but with this above the advert:
// Advert if ($count == 3) { if (!$paywallPro->user->acl['removeAds']) { ?>
The advert then displays when logged in or not. So there is one thing I have missed out and it is probably pretty simple but do not know if it is to do with the global $paywallPro; tag thing not being directly above the code or not.
Thanks for the help on this. Been annoying me for a while!!