I am having to display both adsense and cpalead javascript in all posts,so while making itself calling cpalead javascript for the header,what should I do with this? single.php starts with <?php get_header(); ?> <?php global $options; foreach ($options as $value) { if (get_settings( $value['id'] ) === FALSE) { $$value['id'] = $value['std']; } else { $$value['id'] = get_settings( $value['id'] ); } } ?> <div id="container"> <div id="left-div"> <?php if (have_posts()) : ?> <?php while (have_posts()) : the_post(); ?>
If you want to display something on the top of all pages you have to write it in header.php of the theme directory.
So write this in the header.php if(is_single()){ /* Here write the code which you want to display */ } Code (markup):