Marketing & Sales Videos, Technology

WordPress Plugin: PostPost (Updated)

Update: This Plugin has been moved to my Projects page and updated to:

PostPost – A WordPress Plugin to place customized content before and after each post in your site or your feed.

Commission Junction Feed Advertisement

I wrote this plugin after trying to add advertising to my feed by myself and getting frustrated. It’s my first ‘complete’ plugin but I think it’s written very cleanly. I really figured out the Plugin architecture utilizing Simple Thoughts’ Copyright Plugin. I utilized the construction of Ryan Duff’s WP Contact Form plugin to write it much more constructively. It’s an excellent plugin to download and learn how to write a plugin since it’s so simple.

24 Comments

  1. 1

    Doug – This is awesome. I’ve been putting off writing my own in hopes of someone else doing it. I’m not running ads, but am planning on having some feed only stuff coming up. This will be perfect. Thanks!

  2. 4
    • 5

      That it was! It was one of my goals for 2007 to write my own plugin from scratch. I’ve modified many other people’s plugins but this is the first that I took on. It’s now being used to serve my Google Ads under each post as well as my RSS Feed ads.

      Fun stuff… and 2 goals down! (One of my others was to get into the Top 5,000 at Technorati… I hit that already but it was with the assistance of many “Z-List” posts, so I’ll wait for the stats to iron themselves out before I celebrate).

      Cheers!
      Doug

  3. 6

    DOH! I also noticed that it showed up on the page posts… so I just modified it and released 1.1.1. I think that’s a release speed record! Now you can also customize the content before and after the page.

  4. 7

    Thanks for this, one quick thought for you though – I believe Google AdSense place a limit of 4 (5?) adverts per page, so if you add AdSense code after/before each post, and you have the option set to more than 5 posts viewed per page, there could theoretically be an issue.
    Not meant as a complaint, as I don’t even use them any more (terminated my account :

    • 8

      I’m going to check on that Chris! I am trying to ‘toy’ with the idea of random, and nth placement for these. As well, I’m going to work in header and footer customization. The plugin is written quite well (I ‘borrowed’ other structures from other well-written plugins) so I’m going to continue to expand it.

      Thanks!

  5. 9
    • 10

      I’m not sure how their Policy Page should be implemented. It states that there can be up to 2 ads per product. That’s interesting… example, If I have 8 posts (products) on a page with a Google Ad under each one, I don’ think I’m violating their policy.

      I did see some older rules where it stated 4 per page – but those appear to be long gone. Perhaps because of situations like this. Interesting! I also notice that sometimes an ad is not generated by the script – I wonder if they have an internal control mechanism built in.

  6. 11
  7. 12

    Hi, back again. Thanks for your e-mail, apologies in taking so long to respond.

    One request, and two bugs.
    Well the bugs may be down to my theme, I’m not sure…

    1 – Would it be possible to alter the frequency of inserted adverts between posts – I feel I now have too many ads on my site :> I originally thought on the possibility of basing this on odd and even numbered posts, but I then realised that post numbers with no post attached weren’t re-used in WP. Example, you write a draft, post a few other posts, then delete the draft. Unless there is another reason for my post #s not being concurrent, you would end up with a sequence like 431,433,434 . Not sure how easy it would be to implement a POST_AD_POST_POST_AD_POST_POST sort of layout, any thoughts?

    2 – (ONLY) When looking at posts via clicking on my Categories, often the ad code isn’t interpreted – this only seems to occur on short posts. As an example, if you go to my site and click on the Pictures categories, the first three posts display the code, not the output.

    3 – Doesn’t appear to work when requesting adverts in the footer section.

    Like I said, these issues may be down to the theme I’m using (Anaconda, check my site for a link), I was just hoping to get your input on this when you get a moment…

  8. 13

    I had to take down the per-post ads, as a number of readers had commented on the appearance of short posts when viewed via the category links.
    If you happen to find 5/10 minutes spare, could you contact me, and I’ll happily re-insert the code, if you fancy tracing the issue.
    Thanks.

  9. 14

    I’m guessing this post isn’t checked very often?
    I tried checking the project page, but couldn’t see a comment section, so mailed you a while back.
    I’m now not using ads in the same way, but wonder if other users might still find the features I mentioned above useful.

    • 15

      Ooops! Sorry, Chris! I missed this comment for some reason. I do have a number of improvements that I would like to make on the project, I just need to get around to them!

  10. 16

    np, glad you’ve seen the comments. Did you get the e-mail describing how on category pages, the adverts were sometimes rendered without being interpreted? Not sure if that is how you should technically phrase it, but instead of an advert, I basically saw the html for it instead…
    No hurry requested on my part – I’m fiddling with other things myself right now…

  11. 17

    Released PostPost 1.2.0 today! It utilizes the is_single function of WordPress so you should be able to post something before or after a single post page.

    I can’t seem to get it working on my blog, though. I’m reading at WordPress support that some other folks are having problems with their template and the is_single function. It doesn’t break anything, it just doesn’t display anything.

    Let me know if it works for your blog, though!

  12. 19

    Doug: nice plug-in – short & simple. I’m using the default WordPress theme (v 1.6) and the “After Single Post on Page” option does not seem to display anything.

    Did you ever solve the is_single problem?

    • 20
      • 21

        Doug: thanks for the fast reply! So, I guess I did a poor job of asking my question. I seem to be having some issues with how PostPost works with my blog specifically with the single post display option.

        Not that it really matters, but my blog is located at:
        http://www.theaccidentalnegotiator.com/

        It looked like you and a commenter (is that a word?) were discussing this very problem back at the beginning of 2008.

        Was it a problem back then? Does the ?After Single Post on Page? work on your blog today?

        I’m more than willing to admit that I’ve screwed something up, but first I’m just checking to see if everyone else is having the same problem.

        I’ve looked at your code and it’s nice & clean, so for right now I’m blaming “is_single”.

        Let me know what you think.

  13. 22

    Hi Doug,

    I am trying to install PostPost plugin and it works great. I am putting a promotion after each post but I am having an issue. The promotion is being displayed in the categories / homepage where I have kept the more tag. The promotion appears after the READ MORE link. Is there a way we can fix that? Not show after READ MORE link??

    Thanks for your help.

    Chandra

Leave a Reply