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 » RSS, Feeds & Subscribing »

Javascript, Adsense, RSS, and Comments


  #1  
Old Mar 25, 2009, 11:18 AM
Jerry's Avatar
Jerry
 
65 posts · Feb 2009
The beautiful Pacific Northwest USA
Hi Flynn,
It's been awhile, I hope you and yours are doing well!
I want to make some changes to my site http://enaturesremedies.com/
I figured I'd ask in one place, hope that works ok.
1. I would like to offer Amazon books at the bottom of each page (I'm using a new page-page for each new post.) I want to put a piece of javascript in so that when you hover over the image of the book you see a little window with more info. I can put it after the Adsense code you showed me here.
2.I want to inbed another Adsense block into my articles in addition to the Adsense block I inbedded in the link above (at the start of each article.) I think I can follow those instructions and get it done?
3.I have the email up-dates working with my Feedburner account, but since I'm creating a new page for each article the post feed won't work? I want to offer a feed for each new page.
4.I want to put info that will appear on each new page instructing people on the comment policy.
5.I also want to take away the ability of commenters to link out with their name or within the comment itself, on page-pages.I would like to leave that ability intact on the "home" page though.
I know I'm asking a lot here, and I hope it proves to not be too difficult
I of course am headed to the donate page right now!
Thanks for all your help Flynn
  #2  
Old Mar 25, 2009, 12:45 PM
Flynn's Avatar
Flynn
 
3,768 posts · Oct 2008
Munich, Germany
1. & 2. Put this at the bottom of functions.php (instead of the other, similar code you have there now)

PHP Code:
<?php        
function bfa_add_adsense($post_body_content) {
$adsense_ad '
<div class="bfa-adsense">
WHOLE
ADSENSE
AD
HERE
</div>
'
;
$adsense_ad_2 '
<div class="bfa-adsense-2">
WHOLE
ADSENSE #2
AD
HERE
</div>
'
;
$amazon_ad '
<div class="bfa-amazon">
WHOLE
AMAZON
AD
HERE
</div>
'
;

if ( 
is_single() OR is_page() ) {
if (
strpos($post_body_content,'%adsense%')!==FALSE) {
// Replace %adsense% with content of $adsense_ad_2
$post_body_content str_replace('%adsense%'$adsense_ad_2$post_body_content);
}
// Add $adsense_ad at top and $amazon-ad at bottom
$post_body_content $adsense_ad $post_body_content $amazon_ad;
return 
$post_body_content;
}
add_filter('the_content''bfa_add_adsense');
?>


CSS Insert (example)

HTML Code:
div.bfa-adsense {
float: left;
display: block;
margin: 1em 10px 5px 0; /* margin 1em top, 10px right, 5px bottom, 0 left */
}
div.bfa-adsense-2 {
float: right;
display: block;
margin: 10px; 
}
div.bfa-amazon {
display: block;
margin: 1em; 
}
3. This plugin seems to enable Feeds for "Page" pages http://www.devtrench.com/quick-and-d...e-feed-plugin/

4. In index.php put

PHP Code:
<?php if ( is_page() ) {?>
Text or HTML to appear on all pages
<?php ?>
wherever you want the text to appear, i.e. right before

PHP Code:
<?php // Load Comments template (on single post pages, and "Page" pages, if set on options page)
  #3  
Old Mar 25, 2009, 01:03 PM
Jerry's Avatar
Jerry
 
65 posts · Feb 2009
The beautiful Pacific Northwest USA
Thanks Flynn,
I really appreciate the quick and thorough reply!
  #4  
Old Mar 25, 2009, 01:16 PM
Flynn's Avatar
Flynn
 
3,768 posts · Oct 2008
Munich, Germany
5. What do you want to do with the links. Should the link URL be displayed?

<a href="http://www.commenters-site.com/" rel="nofollow">this site</a>

becomes, i.e.

this site [URL: http://www.commenters-site.com/]

or

this site

or

http://www.commenters-site.com/ (not linked)

Bookmarks



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] How to remove Entries RSS, Comments RSS, and Wordpress.org on sidebar streetx Sidebars & Widgets 4 Jun 21, 2009 07:49 PM
How to change the RSS and Comments icon to a bigger one??? ngc RSS, Feeds & Subscribing 6 Jun 19, 2009 01:52 PM
Putting Adsense or RSS news feed in sidebar Equity Sidebars & Widgets 1 Apr 25, 2009 06:15 AM
removing the Entries RSS, Comments RSS & Wordpress.org default links earlalger Header configuration & styling 2 Mar 8, 2009 07:09 PM
Delete comments and rss links in logo area Scarlett RSS, Feeds & Subscribing 4 Mar 4, 2009 07:09 PM


All times are GMT -6. The time now is 05:46 PM.


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