1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

A little PHP help please (wordpress theme)

Discussion in 'BlackHat Lounge' started by BlackxHat, Apr 1, 2012.

  1. BlackxHat

    BlackxHat Power Member

    Joined:
    Oct 6, 2009
    Messages:
    591
    Likes Received:
    78
    I using this theme called Zionn and it has an option built into the theme where you can add a 468x60 ad block in the header. All you have to do is go into the theme options and put in your adsense ID and the 468x60 ad block shows up in the header. The problem is that you can only use that 468x60 ad block header and I want to use a bigger one.

    Below is the header.php. And I want to directly place the adsense code in there. What should I remove/replace? I've tried doing it myself but i keep breaking the theme

    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php bloginfo('charset'); ?>" />
    
    <?php 
    $zenverse_global_meta = get_option('zenverse_global_meta');
    if ($zenverse_global_meta != '') { echo stripslashes($zenverse_global_meta); }
    ?>
    
    <title><?php 
    if (is_home ()) { 
    echo get_bloginfo('name').' - '.get_bloginfo('description'); 
    } else {
    wp_title('|', true, 'right');
    echo get_bloginfo('name');
    }
    ?></title>
    
    <!--PageNavi Stylesheet-->
    <link rel="stylesheet" type="text/css" media="screen" href="<?php bloginfo('template_url');?>/pagenavi-css.css" />
    <!--End of PageNavi Stylesheet-->
    <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="alternate" type="application/atom+xml" title="<?php bloginfo('name'); ?> Atom Feed" href="<?php bloginfo('atom_url'); ?>" />
    <link rel="pingback" href="<?php bloginfo('pingback_url'); ?>" />
    
    <script type="text/javascript" src="<?php bloginfo('template_url'); ?>/js/tabber.js"></script>
    <link rel="stylesheet" href="<?php bloginfo('template_url'); ?>/tabber.css" type="text/css" media="screen" />
    <script type="text/javascript" src="<?php bloginfo('template_url'); ?>/js/zenverse_gallery.js"></script>
    <link rel="stylesheet" href="<?php bloginfo('template_url'); ?>/comments.css" type="text/css" media="screen" />
    
    <!--[if IE]>
    <link rel="stylesheet" type="text/css" media="screen" href="<?php bloginfo('template_url');?>/ie.css" />
    <![endif]-->
    
    <!--WP Head-->
    <?php wp_head(); ?>
    <!--End of WP Head-->
    
    </head>
    <body>
    <div id="fb-root"></div>
    <script>(function(d, s, id) {
      var js, fjs = d.getElementsByTagName(s)[0];
      if (d.getElementById(id)) return;
      js = d.createElement(s); js.id = id;
      js.src = "//connect.facebook.net/en_US/all.js#xfbml=1";
      fjs.parentNode.insertBefore(js, fjs);
    }(document, 'script', 'facebook-jssdk'));</script>
    
    <?php
    $zenverse_global_feedburner_url = get_option('zenverse_global_feedburner_url');
    $zionn_wpfeed_dump = get_option('zionn_wpfeed_dump');
    if ( $zenverse_global_feedburner_url != '' && $zionn_wpfeed_dump == 'true') { 
    $zionn_rss_link = $zenverse_global_feedburner_url;
    } else { 
    $zionn_rss_link = get_bloginfo('rss2_url');
    }
    ?>
    
    <a name="top"></a>
    <div id="pagenav">
    <div class="onethousand_wrap">
    <!--<ul>
    <li style="padding-left:10px;border:0px;"><a href="<?php echo get_option('home'); ?>/">Home</a></li>-->
    <?php wp_nav_menu(array('menu_class' => 'dropdown', 'menu' => 'top-menu')); ?>
    <!--</ul>-->
    
    </div><!--/onethousand_wrap-->
    </div><!--/pagenav-->
    
    <div id="header">
    <div class="onethousand_wrap" style="position:relative;">
    
    <?php
    $zionn_logo = get_option('zionn_logo');
    $zionn_customlogo = get_option('zionn_customlogo');
    
    if ($zionn_logo == "1" && $zionn_customlogo != '') { ?>
    
    <h1><a href="<?php echo get_option('home'); ?>/" title="<?php htmlspecialchars(bloginfo('name')); ?>"><img src="<?php echo $zionn_customlogo; ?>" alt="<?php htmlspecialchars(bloginfo('name')); ?>" title="<?php htmlspecialchars(bloginfo('name')); ?>" /></a></h1>
    
    <?php } else { ?>
    
    <div class="textlogo">
    <h1><a href="<?php echo get_option('home'); ?>/" title="<?php htmlspecialchars(bloginfo('name')); ?>"><?php bloginfo('name'); ?></a></h1>
    <h2><?php bloginfo('description'); ?></h2>
    </div>
    
    <?php } ?>
    
    <?php
    $zenverse_global_adsense_id = get_option('zenverse_global_adsense_id');
    $zionn_adsense_header_enable = get_option('zionn_adsense_header_enable');
    if ($zenverse_global_adsense_id && $zionn_adsense_header_enable == 'true'){ 
    ?>
    <div class="adsense-header">
    <script type="text/javascript">
    //<![CDATA[
    google_ad_client = "pub-<?php echo $zenverse_global_adsense_id; ?>";
    google_ad_width = 468;
    google_ad_height = 60;
    google_ad_format = "468x60_as";
    google_ad_type = "text";
    google_ad_channel = "";
    google_color_border = "777777";
    google_color_bg = "777777";
    google_color_link = "cccccc";
    google_color_text = "cccccc";
    google_color_url = "cccccc";
    google_ui_features = "rc:0";
    //]]>
    </script>
    <script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
    </div>
    <?php } ?>
    </div><!--/onethousand_wrap-->
    </div><!--/header-->
    
    <div id="navbar">
    <div class="onethousand_wrap">
    <div class="navbarwrap">
    <ul>
    <br/>
    <style type="text/css">
    /* Main Searchbox */
    .searchbox {
      background: url(.org/searchbox_bg.png) 11px 0px no-repeat;
      height: 177px;
      width: 1022px;
      display: block;
    }
    /* Search txt */
    .searchtxt { 
      background: url(.org/searchtxt.png) 40px 20px no-repeat;
      height: 77px;
      width: 800px;
      padding-left: 200px;
      position: absolute;
    }
    /* Search input bar */
    .searchbar {
      border: 0px; 
      background: transparent;
      font-size: 16px;
      height: 27px;
      line-height: 27px;
      width: 317px;
      margin-left: 52px;
    }
    /* Search button */
    .searchbutton {
      padding-left: 17px;
      width: 96px;
      height: 27px;
    }
    /* Browse by artist */
    .broart {
      color: #FFF;
      font: 12px arial;
      background-color: #0B2354;
      vertical-align: middle;
      text-align: center;
      padding-top: 3px;
      width: 110px;
      height: 18px;
      -moz-border-radius: 5px;
      border-radius: 5px;
    }
    /* For AtoZ links */
    div.atoz {
      padding-left: 35px;
    }
    .atoz a {
      font-size: 17px;
      font-family: arial;
      text-transform: uppercase;
      color: #2c3057;
      padding: 0px 2px;
    }
    .atoz a:hover, a.active {
      color: #fff;
      background-color: #2c3057;
    }
    </style>
    <div class="searchbox">
     <div class="searchtxt"></div>
     <div style="min-height:70px;height:70px"></div>
     <div style="height:30px">
      <form action="<?php bloginfo('url'); ?>/" method="get">
       <input type="text" name="s" value="<?php the_search_query(); ?>" class="searchbar" />
       <input type="image" src=".org/search_button.gif" alt="Search" class="searchbutton" />
      </form>
     </div>
     <div style="min-height:15px;height:15px"></div>
     <div style="padding-left:35px"><div class="broart">Browse by artist:</div></div>
     <div style="min-height:5px;height:5px"></div>
     <div class="atoz">
      <?php
       $atoz = array(
                 'a' => 'http://google.com/',
                 'b' => '',
                 'c' => '',
                 'd' => '',
                 'e' => '',
                 'f' => '',
                 'g' => '',
                 'h' => '',
                 'i' => '',
                 'j' => '',
                 'k' => '',
                 'l' => '',
                 'm' => '',
                 'n' => '',
                 'o' => '',
                 'p' => '',
                 'q' => '',
                 'r' => '',
                 's' => '',
                 't' => '',
                 'u' => '',
                 'v' => '',
                 'w' => '',
                 'x' => '',
                 'y' => '',
                 'z' => ''
                );
       foreach(range('a','z') as $i){echo "<a class=\"atoz\" href=\"{$atoz[$i]}\">".$i."</a> ";}
      ?>
     </div>
    </div>
    </div>
    
    </ul>
    </div>
    </div><!--/onethousand_wrap-->
    </div><!--/navbar-->
    <br/><br/><br/><br/>
    <div id="page">
    
     
  2. Contr0l

    Contr0l Newbie

    Joined:
    Mar 26, 2012
    Messages:
    28
    Likes Received:
    9
    I haven't read it but you probably can't. It will interfere with the other elements on the theme and cause it to mess up.
     
  3. BlackxHat

    BlackxHat Power Member

    Joined:
    Oct 6, 2009
    Messages:
    591
    Likes Received:
    78
    What other elements? like the function.php? it can't be too hard, i really want to change this because it should really affect my adsense earning
     
  4. cb.ikt

    cb.ikt Newbie

    Joined:
    Feb 18, 2012
    Messages:
    18
    Likes Received:
    5
    Your adsense code is between

    <div class="adsense-header">

    and

    ...pagead/show_ads.js"></script> </div>
     
  5. audioguy

    audioguy Power Member

    Joined:
    Jun 12, 2010
    Messages:
    609
    Likes Received:
    224
    Location:
    Anywhere in the world building WP sites.
    The layout is not in the code, but in the CSS.
     
  6. absztra

    absztra Newbie

    Joined:
    Mar 28, 2012
    Messages:
    48
    Likes Received:
    53
    Edit this:

    Also, you have to edit the .CSS file in your theme directory.
     
  7. cb.ikt

    cb.ikt Newbie

    Joined:
    Feb 18, 2012
    Messages:
    18
    Likes Received:
    5
    Thats actually not exactly correct. The layout of the displayed banner he'd like to change is in the header.php

    It is true that there could be some more layout commands in the css influencing the overall looks.
     
    • Thanks Thanks x 1
  8. BlackxHat

    BlackxHat Power Member

    Joined:
    Oct 6, 2009
    Messages:
    591
    Likes Received:
    78
    anybody wanna PM/post me their skype or other IM they use
     
  9. cb.ikt

    cb.ikt Newbie

    Joined:
    Feb 18, 2012
    Messages:
    18
    Likes Received:
    5
    skype: xcb88x
     
    • Thanks Thanks x 1
  10. cb.ikt

    cb.ikt Newbie

    Joined:
    Feb 18, 2012
    Messages:
    18
    Likes Received:
    5
    I just fixed his problem.

    For anyone encountering the same problem with this template: The adsense code seems to be outdated. replace it with a newly generated code and add your adsense ca-pub without "ca-pub-" to the theme's configuration and hit the display checkbox.
     
    Last edited: Apr 1, 2012
  11. xxpaigexx

    xxpaigexx Registered Member

    Joined:
    Apr 6, 2009
    Messages:
    83
    Likes Received:
    27
    Mate jsut edit this part :)
    Code:
    <script type="text/javascript"> //<![CDATA[ google_ad_client = "pub-<?php echo $zenverse_global_adsense_id; ?>"; google_ad_width = 468; google_ad_height = 60; google_ad_format = "468x60_as"; google_ad_type = "text"; google_ad_channel = ""; google_color_border = "777777"; google_color_bg = "777777"; google_color_link = "cccccc"; google_color_text = "cccccc"; google_color_url = "cccccc"; google_ui_features = "rc:0"; //]]> </script> <script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script> </div>
    especially these 3 things

    google_ad_width = 468; google_ad_height = 60; google_ad_format = "468x60_as";

    or a better alternate is replace the whole code and put ur ad code inside
     
  12. BlackxHat

    BlackxHat Power Member

    Joined:
    Oct 6, 2009
    Messages:
    591
    Likes Received:
    78
    its not working, I tried a lot of stuff, Anybody want to PM me their AIM or skype pleassee