Support » Plugin: WordPress Popular Posts » Custom Post Type Thumbnail is not showing

  • Resolved malandi

    (@malandi)


    <?php

    $args = array(

    ‘post_type’ => ‘series’,
    ‘limit’ => 5,
    ‘range’ => ‘custom’,
    ‘time_quantity’ => 1,
    ‘time_unit’ => ‘hour’,
    ‘term_id’ => ’28’,
    ‘rating’ => 1,
    ‘thumbnail_width’ => 55,
    ‘thumbnail_height’ => 77,
    ‘post_html’ => ‘{thumb} {title} <div class=”wpp-rating”>{rating}</div>’
    );
    wpp_get_mostpopular($args);

    ?>

    • This topic was modified 1 month, 2 weeks ago by malandi.
Viewing 14 replies - 1 through 14 (of 14 total)
  • Thread Starter malandi

    (@malandi)

    the default one via widget is working fine but in this case the code is not working please help…

    Plugin Author Héctor Cabrera

    (@hcabrera)

    Hi @malandi,

    Just tested your code and for me it rendered the thumbnails just fine.

    The only difference -as you’ll see on the screenshot and on the code below- is that I commented out the term_id and rating parameters since my term IDs will be different than yours and that I don’t have the WP-Post Ratings plugin installed on my test site, however none of them should have any impact on your popular posts thumbnails.

    <?php
    $args = array(
    	'post_type' => 'series',
    	'limit' => 5,
    	'range' => 'custom',
    	'time_quantity' => 1,
    	'time_unit' => 'hour',
    	/*'term_id' => '28',
    	'rating' => 1,*/
    	'thumbnail_width' => 55,
    	'thumbnail_height' => 77,
    	'post_html' => '{thumb} {title} <div class="wpp-rating">{rating}</div>'
    );
    wpp_get_mostpopular($args);
    ?>

    If you’re using a caching plugin on your website please make sure to flush its cache so changes you make to your website to be applied right away. If that’s not the case and your popular posts thumbnails are still not showing then please share your site’s URL and tell me where this popular posts list is so I can have a look

    Thread Starter malandi

    (@malandi)

    <?php
    $args = array(
    	'post_type' => 'post',
    	'limit' => 5,
    	'range' => 'custom',
    	'time_quantity' => 1,
    	'time_unit' => 'hour',
    	/*'term_id' => '28',
    	'rating' => 1,*/
    	'thumbnail_width' => 55,
    	'thumbnail_height' => 77,
    	'post_html' => '{thumb} {title} <div class="wpp-rating">{rating}</div>'
    );
    wpp_get_mostpopular($args);
    ?>

    still no luck , i already install new wordpress theme with twente twente theme in my localhost still no luck do i need to set my wp setting into something?

    https://paste.pics/5a6c98e71f4fc9a56487b56c56fc3761

    Plugin Author Héctor Cabrera

    (@hcabrera)

    No, I don’t think your WP settings matter in ths instance. Otherwise thumbnails wouldn’t have showed up with the WPP widget either.

    How exactly are you adding the wpp_get_mostpopular() to your site?

    Thread Starter malandi

    (@malandi)

    This my actual code, i test it with ACF everything is perfect but choosing featured image was not working…

    <?php
    $args = array(
        
    'post_type' => 'series',
    'range' => 'custom',
    'time_quantity' => 1,
    'time_unit' => 'day',
    'term_id' => '28',
    'rating' => 1,
    'thumbnail_width' => 75,
    'thumbnail_height' => 100,
    'post_html' => 
    '<div class="best-of-the-month-flex">
    {thumb}
    <div class="best-of-the-month-image">
    <div class="best-of-the-month-image-top-list">Top {item_position}</div> 
    </div>
    
    <div class="best-of-the-month-info">
    
    <div class="best-of-the-month-rating">
    
    <span><a href="{url}">{text_title} </a></span> 
    </div>
    
    <div class="ratingmystar-container">
    <span class="ratingmystar">{rating}</span>
    <span> # of Views: {views}</span>
    </div>
    
    </div>
    </div>'
    
    );
    wpp_get_mostpopular($args);
    ?>
    Plugin Author Héctor Cabrera

    (@hcabrera)

    ACF? What do you mean? Are you selecting your featured image with ACF instead of the built-in Featured Image functionality?

    Thread Starter malandi

    (@malandi)

    No i’m just testing it. i just want wordpress default feature image to show on popular post thumbnail please help me…!!! please help. may be video i will follow itt.

    Plugin Author Héctor Cabrera

    (@hcabrera)

    Yeah if you can make a video of the issue and how to reproduce it that might helpful.

    Thread Starter malandi

    (@malandi)

    Plugin Author Héctor Cabrera

    (@hcabrera)

    Alright, thanks. I’ll have a look as soon as possible.

    Thread Starter malandi

    (@malandi)

    Thank you. i need your plugin verybadly…

    Plugin Author Héctor Cabrera

    (@hcabrera)

    Well, I had a look at your screenshots and everything looks normal to me.

    I also ran the code you posted above and it worked.

    I’d say that there’s something on your setup that’s causing the issue. What that “something” is I honestly couldn’t say. Maybe try uploading your site to another server (eg. a staging site) and see whether WPP has issues rendering thumbnails there as well.

    • This reply was modified 1 month, 2 weeks ago by Héctor Cabrera. Reason: Fixed typo
    Thread Starter malandi

    (@malandi)

    Hello sir! the thumbnail is now working the only problem that we had the plugin is not working on localhost i tested it with the live server it worked! thanks!

    Plugin Author Héctor Cabrera

    (@hcabrera)

    Nice! Now we know for sure that you do have issues on localhost that are preventing WPP from creating thumbnails on your machine. Things I’d check:

    • File & folder permissions: the plugin needs to be able to create and store thumbnail images in your /wp-content/uploads folder, more specifically in /wp-content/uploads/wordpress-popular-posts. See Changing File Permissions for more details.
    • Make sure that you have all the required PHP extensions installed on your server (this isn’t likely the issue though since you are able to upload Featured Images to your posts but it won’t hurt to double check).
    • Your featured images are on your local server and not on a external site, like a CDN for example.
Viewing 14 replies - 1 through 14 (of 14 total)
  • You must be logged in to reply to this topic.