|
#1
Jul 19, 2011, 03:56 AM
|
|
Ansense and other code with php conditional in byline
I am trying to learn these php conditional strings/codes, espcially after the newer Atahualpa, where you can't add stuff (like adsende) via the ATO.
As for now I need adsense to be in the Byline.
So far I've come up with:
I need this adsense code:
<script>blabla adsense blabla</script>
To be in this part in index.php
<?php bfa_post_byline('<div class="post-byline">','</div>'); ?>
Reading this forum over and over lets me know that I need something called
php conditional
And after looking there I think that i might be this one:
is_single() or <?php is_single($post); ?>
But the thing is, I just cant seem to figure out where/how in
<?php bfa_post_byline('<div class="post-byline">','</div>'); ?>
I should put both the adsense-script and the php conditional, I have tried a little here and there, but I get error when trying to load the page afterwards.
Can anyone tell me how the byline string should look like with the php conditional and the adsense script correctly inserted??
And from there I hope I can experiment on my own, with other kind of scripts and places in posts, I belive they work the same way.
Thanks
|
#2
Jul 19, 2011, 08:13 AM
|
|
|
|
23,765 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
|
|
try this, change
HTML Code:
<?php bfa_post_byline('<div class="post-byline">','</div>'); ?>
to
HTML Code:
<?php bfa_post_byline('<div class="post-byline">','<script>blabla adsense blabla</script> </div>'); ?>
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support
|
#3
Jul 19, 2011, 11:47 AM
|
|
No.. It must be something concerning scripts, because I tried to just add text where you said, and that worked fine.
|
#4
Jul 19, 2011, 12:25 PM
|
|
|
|
23,765 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
|
|
why don't you put the script in the ato->Add Html/CSS Inserts->HTML Inserts: Header
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support
|
#5
Jul 22, 2011, 12:34 AM
|
|
That dident work either...
I also tried to insert the code manually in the post, and that does also not work.
It must be something "inside" the loop that are preventing it from working, because I have a Banner-ad (also adsense) that I added in the very very top of index.php before
<?php
And that works fine.
I testet the Ad on another site with Atahualpa, just an older version ( 3.5.3 ), and it works okay there..
Strange..
More strange is that I tried to install that ( 3.5.3 ) instead, on the site where I cant make the ads work, and then all text dissapered, all post and pages are there, but there is nothing in them..
SOo I changed back for the moment....
|
#6
Jul 22, 2011, 03:18 AM
|
|
|
|
23,765 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
|
|
have you tried one of the adsense plug-in's?
Not seeing the site and where and what you are putting in the code, I can't be much help since a simple typo could be causing your issues.
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support
|
|