WordPress.org

Ready to get started?Download WordPress

Forums

Top 10 - Popular posts plugin for WordPress
[resolved] Thumbnail question + display category (4 posts)

  1. evdz80
    Member
    Posted 1 year ago #

    Hi,

    How would I proceed on these 2 questions:

    1. I would like the corresponding category to appear below each link in the TOP10

    2. I have a postmeta field for my thumb, which only contains part of the URL (ie. postmeta value = 12345, so the URL is http://www.whateveryoulike.com/12345.jpg). What do I need to modify to disply my custom thumbnails?

    Thanks for your help, it's a wonderful plugin!!

    Regards
    Edwin

    http://wordpress.org/extend/plugins/top-10/

  2. Ajay
    Member
    Plugin Author

    Posted 1 year ago #

    evdz, unfortunately, there isn't a quick solution to either questions. Both would require big changes to the code.

    1. For this edit top-10.php to use get_the_category function to pull the category.
    Alternatively use the $categories variable that has been set.
    Lines 247-268 would be where you modify the code.

    2. Line 639 would be where you can edit this to amend the line:
    $postimage = get_post_meta($result->ID, $thumb_meta, true);

    to something like:

    $postimage = 'http://www.whateveryoulike.com/'.get_post_meta($result->ID, $thumb_meta, true).'.jpg';

  3. evdz80
    Member
    Posted 1 year ago #

    Thanks Ajay,

    Too bad I had to go into the actual plugin to hardcode my changes.. I wont be able to update the plugin that easily anymore with future upgrades..

    However I did manage to get it working (about) the way I wanted using your suggestions!

    The result: http://www.judovision.org/weekly-top-10

    Thanks again for your help!
    Regards
    Edwin

  4. Ajay
    Member
    Plugin Author

    Posted 1 year ago #

    evdz, do you want to shoot the code across to me? Am at me AT ajaydsouza DOT com

    In the next version, I plan on creating a function that just returns the top posts in an array of post IDs.

    After that you can use this function to do whatever you want in your template. It's a feature for power users who want to totally customise the display and are familiar with PHP and WordPress files.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.