WordPress.org

Support

Support » Plugins and Hacks » [Resolved] Hide related posts if no thumbnail

[Resolved] Hide related posts if no thumbnail

Viewing 4 replies - 1 through 4 (of 4 total)
  • i have another issue , if a post has not tags, the plugin send me this Warning: Invalid argument supplied for foreach() in /homepages/xx/xx/htdocs/xxx/wp-content/plugins/easy-related-posts/erp_widget.php on line 180

    Any idea?

    Thanks

    Plugin Author xdark
    Member

    @xdarkeu

    i have another issue , if a post has not tags, the plugin send me this Warning: Invalid argument supplied for foreach() in /homepages/xx/xx/htdocs/xxx/wp-content/plugins/easy-related-posts/erp_widget.php on line 180

    Any idea?

    Thanks

    Check this

    Hello

    has mention in the title, is it possible to hide a post with same tag if there is no thumbnail ? or give a default thumbnail image to this post?

    Thanks you

    Your plugin is really cool 😉

    Yes it is. Are you familiar with php?

    Hello thank you for the link i run php5.4 i Will try to modify as mention.
    I am more désigner than dev but if u give me specific indications i can modify php file

    Plugin Author xdark
    Member

    @xdarkeu

    As for thumbnail mod.
    If you want to display a custom thumbnail if post has no thumbnail, change line 219 in file erp_display:
    original:

    $thumb_display = 0;

    modified:

    $thumb_display = <img src="your-custom-thumb-url"/>

    if you want not to display the post if it hasn’t a thumbnail, then in same file add at line 202 the following snippet:

    if (!has_post_thumbnail(get_the_ID())) { continue; }

    Those should do the trick

    Panos Vagenas

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘[Resolved] Hide related posts if no thumbnail’ is closed to new replies.