Wordpress Themes - WP Forum at BFA
There will be no more development for Atahualpa (or any other theme), and no support. Also no new registrations. I turned off the donation system. I may turn the forum to read only if it gets abused for spam. Unfortunately I have no time for the forum or the themes. Thanks a lot to the people who helped in all these years, especially Larry and of course: Paul. Take care and stay healthy -- Flynn, Atahualpa developer, Sep 2021

Wordpress Themes - WP Forum at BFA » WordPress Themes » Atahualpa 3 Wordpress theme » Center area post/pages »

How to add adbrite code in the center column. Please Help.


  #1  
Old Mar 30, 2010, 05:59 PM
jack512
 
2 posts · Mar 2010
NewYork, NY
Hello everyone. First off my hats off to the developers of this wordpress theme. This the first time I'm posting on this forum. I have not donated yet but plan to make one very very soon.

So, adsense was a breeze to be added in the content. on the left side by adding custom css and the code in functions.php what i did is below. Based on a post by Flynn.

Below is the code added to Custom css and html inserts in Atahualpa options.

Code:
div.bfa-adsense {
float: left;
display: block;
margin: 0em 10px 5px 0; /* margin 0em top, 0px right, 5px bottom, 0 left */
}
Then i added the follwing code at the bottom of functions.php

Code:
function bfa_add_adsense($post_body_content) {
    $adsense_ad = '<div class="bfa-adsense">
    <script type="text/javascript"><!--
google_ad_client = "pub-123456789043783284782";
/* 336x280, created 2/24/10 */
google_ad_slot = "74539475983";
google_ad_width = 336;
google_ad_height = 280;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
    </div>';
    if ( is_single() ) {
        if (strpos($post_body_content,'%adsense%')!==FALSE) {
            $post_body_content = str_replace('%adsense%', $adsense_ad, $post_body_content);
        } else {
            $post_body_content = $adsense_ad . $post_body_content;
        }
    }
    return $post_body_content;
}
add_filter('the_content', 'bfa_add_adsense');
and it worked like a charm.

But when i tried the same thing with adbrite code..... The page goes blank....nothing comes up.
As you know that google allows only 3 adsense units on one page..... so only the first three posts would have the add.... this is the reason i want to use adbrite.... and instead of displaying the add on the single posts i want it to be displayed on homepage, search results, categories, tag pages, and other places where multiple posts are displayed. I tried bidvertiser code in home page and IT WORKED. Only adbrite is not working.
for bidvertiser i used
Code:
if ( is_home() ) {
instead of
Code:
if ( is_single() ) {
and it worked perfectly.

but when i do the code below for adbrite, the homepage comes blank. Please I really need your help in regard to this problem. I am using Atahualpa 343.
so below is the code that i put in functions.php and the page come blank.

Code:
add_filter('the_content', 'bfa_add_adsense');
function bfa_add_adsense1($post_body_content) {
    $adsense_ad = '<div class="bfa-adsense1">
<!-- Begin: AdBrite, Generated: 2010-03-30 18:13:21  -->
<script type="text/javascript">
var AdBrite_Title_Color = '000000';
var AdBrite_Text_Color = '000000';
var AdBrite_Background_Color = 'FFFFFF';
var AdBrite_Border_Color = 'CCCCCC';
var AdBrite_URL_Color = '000000';
try{var AdBrite_Iframe=window.top!=window.self?2:1;var AdBrite_Referrer=document.referrer==''?document.location:document.referrer;AdBrite_Referrer=encodeURIComponent(AdBrite_Referrer);}catch(e){var AdBrite_Iframe='';var AdBrite_Referrer='';}
</script>
<script type="text/javascript">document.write(String.fromCharCode(61,83,67,22,73,80,83));document.write(' src="http://ads.adbrite.com/mb/text_group.php?sid=34237489273&zs=46236486238&ifr='+AdBrite_Iframe+'&ref='+AdBrite_Referrer+'" type="text/javascript">');document.write(String.fromCharCode(60,27,83,66,82,79,80,84,68));</script>
<div><a target="_top" href="http://www.adbrite.com/mb/commerce/purchase_form.php?opid=34733829&afsid=1" style="font-weight:bold;font-family:Arial;font-size:13px;">Your Ad Here</a></div>
<!-- End: AdBrite -->
    </div>';
    if ( is_home() ) {
        if (strpos($post_body_content,'%adsense%')!==FALSE) {
            $post_body_content = str_replace('%adsense%', $adsense_ad, $post_body_content);
        } else {
            $post_body_content = $adsense_ad . $post_body_content;
        }
    }
    return $post_body_content;
}
add_filter('the_content', 'bfa_add_adsense1');
I also added a separate custom css and html insert in Atahualpa options which looks like
Code:
div.bfa-adsense1 {
float: left;
display: block;
margin: 0em 10px 5px 0; /* margin 0em top, 0px right, 5px bottom, 0 left */
}
This method works for chitika, bidvertiser and adsense, but not for adbrite so please help me.
Also, please advise what would i use instead of
Code:
if ( is_home() ) {
or
Code:
if ( is_single() ) {
for categories, search results.
Thank you all in advance.
Jack.
  #2  
Old Apr 3, 2010, 11:08 PM
jack512
 
2 posts · Mar 2010
NewYork, NY
No one has answered my question.... i waited for 3 days...i posted on march 30th and today is april 3rd.... where is juggledad and where is flynn..... what happened.... people asked questions after me and they were replied to.... but not me? why?

Bookmarks

Tags
adbrite, adsense, atahualpa 3.4.2, bytes for all, wordpress theme editing



Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I add widgets to center column (all posts) in atahualpa? Chloe Center area post/pages 8 Jan 26, 2010 06:43 PM
Can I add widgets to the center column? gaz7575 Sidebars & Widgets 24 Jan 12, 2010 08:01 AM
Center Column Static Page just shows code??? forestwander Atahualpa 3 Wordpress theme 1 Sep 1, 2009 08:21 PM
Add Widgets to Center Column Front Page Only MountainStream Sidebars & Widgets 10 Aug 13, 2009 01:51 PM
Help! Cannot remember where my Adbrite code goes Paleo Pat Atahualpa 3 Wordpress theme 7 Apr 5, 2009 06:45 PM


All times are GMT -6. The time now is 12:17 PM.


Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.