WordPress.org

Ready to get started?Download WordPress

Forums

WordPress Popular Posts
Appending extra code to the end of the HTML markup (2 posts)

  1. wpoon
    Member
    Posted 7 months ago #

    Hi,

    Fantastic plugin, I got a client who wants to add a "see all articles" link to the end of the HTML your plugin generates. I have a widget area which takes in your plugin as a widget and I've selected the "HTML Mark Up" option to generate my own layout of the posts.

    Before / After Title:
    <h3></h3>

    Before / After Posts:
    <ul></ul>

    Post HTML Mark up:

    <li>
    {thumb} 
    
    <h3>{title}</h3> <p>{summary}</p></li>

    What I want to do is add a <div> block after the </ul> which contains a link to the category specified by your the filter's form under the "Category(ies) ID(s):" field. I've edited the plugin to do that, however I'm afraid that when you update the plugin, my code will be overwritten. My question is:

    Can you tell me how to call the content that generates the HTML markup, or provide a function for me to add onto the plugin to do what I require without editing the actual plugin code itself (e.g a hook inside functions.php file).

    http://wordpress.org/plugins/wordpress-popular-posts/

  2. Héctor Cabrera
    Member
    Plugin Author

    Posted 7 months ago #

    Hi there,

    Actually there's a hidden, experimental filter on the plugin which might be what you're after: wpp_html. Use add_filter to hook into it (example).

    I must say that being it an experimental feature chances are that it'll change over time. I might rename it and/or modify its code, so I'd keep an eye on the plugin once I release the new 3.0 version (which I'll be pushing to Github first once I'm done with a few things).

Reply

You must log in to post.

About this Plugin

About this Topic

Tags

No tags yet.