Forums

Append each post in WP with particular code/PHP/HTML (1 post)

  1. MortenBlaabjerg
    Member
    Posted 3 years ago #

    Posted this originally in the WordPress MU forums :
    http://mu.wordpress.org/forums/topic.php?id=9932

    Since this is not particularly a MU functionality question, I thought I'd try my luck here as well. Someone or somebody may already have done a simple plugin to do what I want to do :

    We use FeedWordPress to syndicate and re-publish RSS items on our site. I want to append a string of HTML to every syndicated post, and write that string to the database post, so that the string becomes part of the post and the message it conveys will be published across platforms, when the post is syndicated again via RSS and if/when the post is re-published on another site using a syndication tool such as FeedWordPress.

    After searching high and low for something appropriate already made, I've next to given up on finding something already done, and I've begun to study plugins and find out how to build my own. In that case, this will be my first plugin for WordPress.

    It strikes me I want to address the post when it is published (with the publish_post hook), then create a function which taps into the FWP API via PHP to check if the post was syndicated, and if so, executes a small piece of PHP (get the permalink) and add the resulting HTML to the post in the database. Does this sound right? Would it work?

    If you can give me any pointers to what direction I may look in to find a plugin already written, or pointers as to what direction I ought to go, if I need to write the plugin myself - I'd be really grateful.

Topic Closed

This topic has been closed to new replies.

About this Topic