Jump to content
Sign in to follow this  
dario

Inserting an Ad after 1st post

Recommended Posts

dario+    20
dario

I read through this post here and its corresponding links but am wondering if anything changes with PlatformPro. On my old WP blog I was able to insert the following code on the home.php page of my theme, just before <?php enwhile; ?> :

<?php if(!$show_ads){ ?>
	Insert Code Here
	<?php $show_ads = 1; } ?>

Possible with PlatformPro?

Share this post


Link to post
Share on other sites
catrina    103
catrina

Hello, it might be possible. The best way to find out is to refer to that URL mentioned in the post (http://www.dannyfoo.com/blog/blog-development/how-to-insert-horizontal-banner-between-1st-and-2nd-post/) try it. :)


Please read the docs before posting. Please do not private message me unless I ask you to.

Designer | Catrina Dulay

Founder | Catrina and Mouse

Share this post


Link to post
Share on other sites
dario+    20
dario

Well, that didn't do it for me. Perhaps I missed something? However, if you go to line 123 in platformpro > template.postloop.php you'll see the last of 3 <?php endif;?> tags. This is just after the first mention of 'continue_reading_text'. I put the aforementioned code there and it seems to work (at least locally using MAMP). This placement of the code also seems to put the ad at the end of any single page past. . . . still testing it though. :)

Share this post


Link to post
Share on other sites
dario+    20
dario

Update 1(?) Moving the code down to just after the next <?php endif;?>, which is after the closing <div> for the <div class="entry_content"> works better.

Share this post


Link to post
Share on other sites
michaelmiles    0
michaelmiles

Dario, I haven't tested this on Platform Pro yet, but there was a solution found via this post: http://www.pagelines.com/forum/topic.php?id=805 This worked on WhiteHouse Pro, but I think the basic concepts of the frameworks may be the same. Hope this gets you 100% there...

Share this post


Link to post
Share on other sites
dario+    20
dario

Thanks Michael, I gave that a shot this morning but could not get it to function. I need to play with it some more I guess. In the meantime I moved my fix to the live site and all seems well for now. The ad runs just after the first post on the main blog page. It also runs underneath the post on every page. This last thing was unintended but I kind of like it anyway.

Share this post


Link to post
Share on other sites
cmunns    16
cmunns

If you place it back in the location where it appeared on every post, we could help you code a simple conditional statement so that it only shows up if and when the post count is 1

Share this post


Link to post
Share on other sites
dario+    20
dario

Hi Adam, I missed this reply until now. So I should put it back and then what? Give you the URL or paste the code here, or . . . ? The conditional might also help my other issue which is making the recent post always display in full and the rest of the posts simply display excerpts. I tried the solution via another thread here but failed.

Share this post


Link to post
Share on other sites
cmunns    16
cmunns

Basically to get a full post on the first or most recent post you would make line 125 in template.postloop.php look like this `<?php if(pagelines_show_content( get_the_ID() ) || $count == 1): // Post and Page Content ?>` See the added `|| $count == 1` ? That's the ticket

Share this post


Link to post
Share on other sites
dario+    20
dario

Thanks and we're close. But, the most recent post also displays an excerpt, as do the categories pages. See the results here. -I'll stop adjusting for awhile, until this is seen.

Share this post


Link to post
Share on other sites
cmunns    16
cmunns

line 105 in template.postloop.php, make it this `<?php if(pagelines_show_excerpt( get_the_ID() ) && $count != 1): // Post Excerpt ?>`

Share this post


Link to post
Share on other sites
dario+    20
dario

Bravo! Thanks.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this  

×