Skip to content
This repository has been archived by the owner on Dec 16, 2022. It is now read-only.

Change Featured Image on "Home"-View #297

Closed
websupporter opened this issue Sep 27, 2016 · 1 comment
Closed

Change Featured Image on "Home"-View #297

websupporter opened this issue Sep 27, 2016 · 1 comment
Labels
Milestone

Comments

@websupporter
Copy link

If you open the customizer you are on the "Home"-View. You go to Posts and you select a post, which is visible in this view. You change the featured image and after the refresh, the featured image is shown. From the Posts you select another post also visible on the "Home"-View and you change the featured image, the featured image of the first post you've edited is going to be replaced in the preview.

If you hit "save &publish" the featured images are saved correctly.

@westonruter
Copy link
Contributor

westonruter commented Sep 27, 2016

Good catch. The problem is that the selector for the featured image partial is not specific enough. It's only looking for elements that match the selector [data-customize-featured-image-partial]:

$this->partial_selector = '[' . self::SELECTED_ATTRIBUTE . ']';

$this->partial_selector = '[' . self::SELECTED_ATTRIBUTE . ']';

Here is where the attribute is injected into the featured image element:

$replacement .= sprintf( ' %s="1" ', self::SELECTED_ATTRIBUTE );

$replacement .= sprintf( ' %s="1" ', self::SELECTED_ATTRIBUTE );

This needs to be changed perhaps so that the post/page ID for the featured image is supplied instead of 1. In this way, the featured image partial can target only the relevant placements.

We also may need to dynamically add the partials rather than declare them statically, since the selector is going to change for each.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants