WordPress.org

Ready to get started?Download WordPress

Forums

List category posts
Adding thumbnail size and link (11 posts)

  1. wycks
    Member
    Posted 2 years ago #

    I'm posting this in-case anyone is want to use the thumbnail size using thumbnail=yes and have it work as a link.

    In CatList.php change the

    public function get_thumbnail

    From:
    $lcp_thumbnail = get_the_post_thumbnail($single->ID);

    To:
    $lcp_thumbnail = '<a href="' . get_permalink( $single->ID ) . '">' . get_the_post_thumbnail($single->ID, 'thumbnail') . '</a>';

  2. picandocodigo
    Member
    Plugin Author

    Posted 2 years ago #

    Thanks! Version 0.19 will include thumbnail_size as a parameter, so you will be able to use either a string keyword (thumbnail, medium, large or full) or a 2-item array representing width and height in pixels, e.g. array(32,32) like the native function does.

  3. emcee2
    Member
    Posted 2 years ago #

    I can't get thumbnails to show at all using the plugin, in either a page or widget.
    I'm using the twenty ten theme. I'm pretty sure I'm calling it properly, here are two examples:

    [catlist name=appetizers numberposts=-1 orderby=title order=asc catlink=yes thumbnails=yes thumbnail_size=100,66]
    [catlist name=beef       numberposts=-1 orderby=title order=asc catlink=yes thumbnails=yes thumbnail_size=thumbnail]

    Somewhat lost here, newbie, trying to sort out a website for a friend that was built by someone else. Should the thumbnails be showing with out any additional tweaking, or do I have to fiddle with files and file locations (i.e. templates)?

    Thanks.

  4. picandocodigo
    Member
    Plugin Author

    Posted 2 years ago #

    Hi emcee2,
    The correct parameter for thumbnail to work is thumbnail, without the s.

    Check the documentation for the correct params:

    Thanks!
    Regards

  5. emcee2
    Member
    Posted 2 years ago #

    Hi. My mistake with the extra s. That said, I still cannot get thumbnails to show. I have taken a look at the "tutorial" you listed, but I have to say it becomes a bit confusing - to a newbie - and more so that that tutorial is talking about a previous version of WordPress. The theme I am using is Twenty Ten, and the tutorial talks of putting some PHP calls in the loop... in either home.php or index.php (in the loop), but in the Twenty Ten theme there is a loop.php file... it all gets confusing. Also, the Tweny Ten theme seems to set thumbnails creation to an very large size (940 x 198 pixels)...
    I've tried another theme as well - still cannot get thumbnails to show.

  6. anaisamy
    Member
    Posted 2 years ago #

    emcee2 - I just activated the Twenty Ten theme on my test site and thumbnails worked okay and were at their proper size. Not that that helps you in any way, but wanted to let you know; maybe there's something else you have installed that is causing the funkiness. You do have a featured image set for each post, right?

    picandocodigo - I am having an issue where using the array values to change the thumbnail size is not working. My code looks like: [catlist id=3 thumbnail=yes thumbnail_size=array(50,50)]

    I tried also: [catlist id=3 thumbnail=yes thumbnail_size=(50,50)] and [catlist id=3 thumbnail=yes thumbnail_size=50,50]

    But nothing seems to work to change the thumbnail size using the array values. Using the text values of thumbnail, medium, large works fine. Is my syntax wrong or is there an issue with the plugin?

    Thanks.

  7. emcee2
    Member
    Posted 2 years ago #

    Hi,
    Actually, the featured image is not set for each post. The site owner wanted a static header image at the top of each post. Not sure how that was set up (I'm just a friend of the site owner, trying to help out) by the original designer.
    I wondered about the featured image aspect, but it never delved into it as I doubt she wants to go through and set a featured image for 150 or so posts.
    I presume from you bringing that up that the featured image must be set in order for the thumbnail function to work...
    Thanks.

  8. anaisamy
    Member
    Posted 2 years ago #

    Yes, I believe so. Where else would the thumbnail image be pulled from in relation to the post?

  9. emcee2
    Member
    Posted 2 years ago #

    Good point. I guess I never really considered that... Another example of my lack of knowledge about WordPress and its workings.
    There is another plugin I have come across that pulls the first image it finds in the post... but it makes more sense that the Featured image must be set.
    Thanks again.

  10. robbbblj
    Member
    Posted 2 years ago #

    I dont get this, I've tried and tried, but it doesnt work. I do not want to change the php file if the plugin updates. I would really like to do this with the short code.

    thumbnail_size - Either a string keyword (thumbnail, medium, large or full) or a 2-item array representing width and height in pixels, e.g. array(32,32).

    someone please?

  11. robbbblj
    Member
    Posted 2 years ago #

    I would like to add, I am trying the array thing, to set the thumbnail to 192x100.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic