• Resolved fidoboy

    (@fidoboy)


    The plugin only allows to choose a fixed image size, so it doesn’t create a srcset for responsive images. Is there any way to use a filter to add such functionallity?

    • This topic was modified 11 months, 1 week ago by fidoboy. Reason: typo
Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Kybernetik Services

    (@kybernetikservices)

    Hi @fidoboy.

    I’m sorry but there is no filter to change the image output.

    Thread Starter fidoboy

    (@fidoboy)

    and how can I manage two or more sizes to display images on retina display (2x)?

    Plugin Author Kybernetik Services

    (@kybernetikservices)

    Currently I can not provide a solution for this request. The srcset is an indivdual setting based on the activated theme and the provided image sizes.

    Recent Posts Widget With Thumbnails gets the featured image by using get_the_post_thumbnail();.There’s no direct way to add code for image urls in SRC SET. I have to create a srcset based on the available image sizes. And they can and will be different with each theme. Thats why Recent Posts Widget With Thumbnails does not support srcset.

    I’ll think about whether I can provide an option or at least a filter to adjust these values.

    Thread Starter fidoboy

    (@fidoboy)

    I understand. And that’s a problem for the theme to solve, and not for widgets or display modules.

    However you can provide with filter hooks and document it into the plugin faqs or the right place. It could be also solved with templates, if the plugin provides anyone that could be copied into the child theme folder.

    Kind regards,

    Plugin Author Kybernetik Services

    (@kybernetikservices)

    Hello @fidoboy.

    I had a deeper look into your request and have to write, I can not provide a solution. As I wrote bevore srcset is part of the theme and WordPress.

    As I wrote, Recent Posts Widget With Thumbnails is using get_the_post_thumbnail();. The description of this function is

    When a theme adds ‘post-thumbnail’ support, a special ‘post-thumbnail’ image size is registered, which differs from the ‘thumbnail’ image size managed via the Settings > Media screen.

    The logic of this function is, that it can not provide a srcset because it provides just the ‘thumbnail’ image size. I also discussed this with the WordPress core team and received the same statement. A post thumbnail can have only one size. Otherwise, WordPress should have a built-in option to select a source set for the different sizes. And that’s not planned.

    I’m sorry I can’t give another answer.

    If you still need this feature, feel free to add it yourself. You can send us your updated code so that I can review it and integrate it into the regular version.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Filter hook or an option to manage srcset’ is closed to new replies.