Header only showing on index and not on posts…
-
Hi,
I’m using a randomize plugin from: https://andersdrengen.dk/projects/randomize/
This seems to work perfectly with my index pages and search pages etc. For some reason though when you click on a post I’ve made no header at all shows up?
Can anyone point me in the right direction as to how to solve this? It’s doing my head in!?
I have noticed that the generated pages for the index have the following style produced when I view the source:
<style type=”text/css” media=”screen”>
#header { background: url(“https://www.stuartjackson.co.uk/v1/blog/wp-content/themes/default/images/header10.jpg”) repeat-y top; border: none; }
</style>Whereas the pages for the posts has the following that doesn’t work:
<style type=”text/css” media=”screen”>
#page { background: url(“https://www.stuartjackson.co.uk/v1/blog/wp-content/themes/default/images/kubrickbgwide.jpg”) repeat-y top; border: none; }
</style>Basically I want the post pages to produce the same as the index etc as first example. The random function changes the image to header01.jpg or header09.jpg etc etc…
Header code is as follows if this helps:
<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN” “https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”>
<html xmlns=”https://www.w3.org/1999/xhtml”><head profile=”https://gmpg.org/xfn/11″>
<meta http-equiv=”Content-Type” content=”<?php bloginfo(‘html_type’); ?>; charset=<?php bloginfo(‘charset’); ?>” /><title><?php bloginfo(‘name’); ?> <?php if ( is_single() ) { ?> » Blog Archive <?php } ?> <?php wp_title(); ?></title>
<meta name=”generator” content=”WordPress <?php bloginfo(‘version’); ?>” /> <!– leave this for stats –>
<link rel=”stylesheet” href=”<?php bloginfo(‘stylesheet_url’); ?>” type=”text/css” media=”screen” />
<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’); ?>” /><style type=”text/css” media=”screen”>
<?php
// Checks to see whether it needs a sidebar or not
if ( !$withcomments && !is_single() ) {
?>
#header { background: url(“<?php randomize(header) ?>”) repeat-y top; border: none; }
<?php } else { // No sidebar ?>
#page { background: url(“<?php bloginfo(‘stylesheet_directory’); ?>/images/kubrickbgwide.jpg”) repeat-y top; border: none; }
<?php } ?></style>
<?php wp_head(); ?>
</head>
<body>
<div id=”page”><div id=”header”>
<div id=”headerimg” onclick=”location.href=’index.php'” title=”Return to Homepage!” style=”cursor: pointer;”>
<h1>/”><?php bloginfo(‘name’); ?></h1>
<div class=”description”><?php bloginfo(‘description’); ?></div>
</div>
</div>
<hr />Any help is greatly appreciated as is any other site comments or recommendations.
https://www.stuartjackson.co.uk/v1/blog/
Thanks
Stuart
- The topic ‘Header only showing on index and not on posts…’ is closed to new replies.