Support » Plugin: Default featured image » Default image also set in portfolio items

  • Resolved marcsole


    We have installed Default Featured Image for all post entries and it works like a charm!

    However, our template also has a Portfolio section with video items. These items don’t need a featured image because the template shows the video.

    If we disable the plugin, the portfolio shows all videos. With your plugin enabled the default image appear. Can you help us to solve it?

    Thanks and regards,

Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Author janw.oostendorp


    Hi Marcsole,

    What you want can be done. What do all these video’s have in common? Are they all in the same category? Or are they all a custom posttype? Postformats?
    Is this template set with a meta data?

    If there is one factor that applies to all video’s and only to video’s it can be done.

    Let me know and I’ll give you the code. If you can code a bit maybe you can figure it out with the FAQ examples

    Hello janw,
    These videos have in common that they are in Porfolio section. In portfolio they are in “VÍDEOS” gallery.

    They are not posts entries so they don’t have posttype neither category. In the Portfolio the categories are galleries and they are marked as “VÍDEOS”.

    However, I want that all portfolio items don’t be applied the Default Featured Image.

    The template is La Bomba. And this page is the portfolio:

    I don’t mind about coding in order to solve it.


    Plugin Author janw.oostendorp


    Okay, almost there. I need a bit more.

    1) So Portfolio is it’s own menu item?
    2) galleries works the same as the categories of posts?
    2.b) if yes, what is the url of the galleries edit screen?
    Example: categories edit url is:
    Is the edit of gallery:
    I need the taxonomy name, exactly.
    3) what is the slug of the VÍDEOS gallery? you can should be able to find this on the edit screen.

    Hi, no problem. Let me try to understand everything.

    1) Portfolio it’s a customized section of the template. We also have a menu item with that name that lists portfolio items.

    2) Yes, galleries works the same like categories. I show you admin URL in order to help:

    URL edit portfolio section: /wp-admin/edit.php?post_type=portfolio

    URL edit portfolio galleries (categories): /wp-admin/edit-tags.php?taxonomy=portfolio-gallery&post_type=portfolio

    URL edit portfolio slug gallery: /wp-admin/edit-tags.php?action=edit&taxonomy=portfolio-gallery&tag_ID=1994&post_type=portfolio

    3) The slug is “videos” and the name “VÍDEOS”.

    Plugin Author janw.oostendorp


    Great that’s the information I needed.

    The following code will nog show a Default featured image on items that have videos checked.

    function dfi_skip_video ( $dfi_id, $post_id ) {
      if ( has_term('videos', 'portfolio-gallery', $post_id) ) {
        return 0; // invalid id
      return $dfi_id; // the original featured image id
    add_filter( 'dfi_thumbnail_id', 'dfi_skip_video', 10 , 2 );

    This should work. Let me know.

    Hi, the code looks good. Where do we have to put this function?

    In the plugin edition

    At the end inside class default_featured_image?


    Ok, I find it in functions.php, isn’t?

    The code works perfect.

    You are brilliant, thanks!

    Plugin Author janw.oostendorp


    Hi Marco,

    Forgot to mention this.. You should paste it in your theme functions.php
    If you paste it in my plugin it will be overwritten if it gets an update.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Default image also set in portfolio items’ is closed to new replies.