Jump to content


Photo

Inserting an Ad after 1st post


This topic has been archived. This means that you cannot reply to this topic.
11 replies to this topic

#1 dario

dario

    Super Member

  • Members

  • 124 posts

Posted 13 November 2010 - 03:09 PM

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?

#2 catrina

catrina

    Advocate

  • Members
  • 12345 posts

Posted 13 November 2010 - 07:46 PM

Hello, it might be possible. The best way to find out is to refer to that URL mentioned in the post (http://www.dannyfoo....t-and-2nd-post/) try it. :)

#3 dario

dario

    Super Member

  • Members

  • 124 posts

Posted 14 November 2010 - 12:04 AM

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. :)

#4 dario

dario

    Super Member

  • Members

  • 124 posts

Posted 14 November 2010 - 12:12 AM

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.

#5 michaelmiles

michaelmiles

    Advanced Member

  • Members
  • PipPipPip
  • 45 posts

Posted 14 November 2010 - 02:12 AM

Dario, I haven't tested this on Platform Pro yet, but there was a solution found via this post: http://www.pagelines...opic.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...

#6 dario

dario

    Super Member

  • Members

  • 124 posts

Posted 14 November 2010 - 01:56 PM

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.

#7 cmunns

cmunns

    Advocate

  • Members

  • 6537 posts

Posted 15 November 2010 - 06:47 PM

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

#8 dario

dario

    Super Member

  • Members

  • 124 posts

Posted 16 November 2010 - 01:08 PM

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.

#9 cmunns

cmunns

    Advocate

  • Members

  • 6537 posts

Posted 16 November 2010 - 08:04 PM

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 `` See the added `|| $count == 1` ? That's the ticket

#10 dario

dario

    Super Member

  • Members

  • 124 posts

Posted 16 November 2010 - 09:10 PM

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.

#11 cmunns

cmunns

    Advocate

  • Members

  • 6537 posts

Posted 16 November 2010 - 11:12 PM

line 105 in template.postloop.php, make it this ``

#12 dario

dario

    Super Member

  • Members

  • 124 posts

Posted 16 November 2010 - 11:48 PM

Bravo! Thanks.