WordPress.org

Ready to get started?Download WordPress

Forums

Easy Related Posts
[resolved] Hide related posts if no thumbnail (5 posts)

  1. neoseeyou
    Member
    Posted 9 months ago #

    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 ;-)

    http://wordpress.org/plugins/easy-related-posts/

  2. neoseeyou
    Member
    Posted 9 months ago #

    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

  3. Vagenas Panagiotis
    Member
    Plugin Author

    Posted 9 months ago #

    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?

  4. neoseeyou
    Member
    Posted 9 months ago #

    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

  5. Vagenas Panagiotis
    Member
    Plugin Author

    Posted 9 months ago #

    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

Reply

You must log in to post.

About this Plugin

About this Topic

Tags

No tags yet.