WordPress.org

Making WordPress.org

Opened 11 months ago

Last modified 3 days ago

#3645 new defect

Sponsors single page template should display featured image

Reported by: tar.gz Owned by:
Milestone: Priority: normal
Component: WordCamp Site & Plugins Keywords:
Cc:

Description

The current CampSite 2017 theme (v.1.0.0) isn't displaying featured images for posts or pages.

There is one place where that's an issue: the "Sponsors" custom post type (CPT), added through the wc-post-types plugin.

This CPT expects the sponsors logo to be added as the Featured Image. In this way, it can be displayed via the sponsors shortcode.

This works fine whenever the shortcode is used – in a widget area, or a main sponsors listing produced with the shortcode.

Example of sponsors listing created by the shortcode: https://2018.europe.wordcamp.org/sponsors/

However, the actual "custom post type page" of the sponsor isn't rendered with the shortcode, but with the single post template : template-parts/content.php.

That explains why the logo doesn't show up here.

Example of single sponsor page, created by theme template, where to logo is missing:
https://2018.europe.wordcamp.org/sponsor/bluehost/

This becomes a problem when a WordCamp site admin wants to link to those single sponsor pages – it's an option in the shortcode, "link to the sponsor’s post".

Workarounds

In that case, the site admin will probably add a second logo inside the post content, in order to make it show up on the single page.

This will result in duplicate logos appearing where the shortcode is used. This is currently being solved with CSS workaround, that hide the duplicate logos on specific places.

Proposed solution

The optimal way would be to add a template for the "wcb_sponsor" CPT, which would show the Featured Image.

Attachments (1)

Screen Shot 2018-05-31 at 10.46.36 AM.png (118.5 KB) - added by melchoyce 11 months ago.

Download all attachments as: .zip

Change History (6)

#1 @iandunn
11 months ago

Hmm, what does everyone think of showing the featured image on all content types (if it exists)?

#2 @tar.gz
11 months ago

Some more info on my hands-on experience with the CampSite theme: our main (only?) use for the featured image, apart from the sponsors pages, is to provide an image for sharing pages on social media (call for speakers, call for volunteers, etc). Indeed, the Open Graph functionality, added by Jetpack, uses the featured image.

So we have added featured images that are specially tailored towards social media, have the WordCamp logo and date embedded, etc. It's not really a problem that they don't appear in the layout, as they are selected with regards to social media much more than for the website look-and-feel.

The website having a big visual header that is consistent on every page, a featured image would maybe add too much visual noise.

On the other hand, considering that every WordCamp team may have a different view on displaying featured images, it's pretty easy to hide them with custom CSS, but it's not possible to display if the theme doesn't make them available.

#3 @ryelle
11 months ago

My team has also run into this -- we'd also like the sponsor's featured image to be shown on the sponsor page.

Hmm, what does everyone think of showing the featured image on all content types (if it exists)?

Having the featured image showing on sponsors makes sense with the way the sponsor content is provided to us -- the global sponsor logos are featured images, not images inset into the content. I've also added images to speakers when they don't have gravatars, that could also be a featured image? But for posts…

So we have added featured images that are specially tailored towards social media

We've also done this on posts, so I would probably hide the image on posts if it was turned on.

#4 @melchoyce
11 months ago

Could we adapt Automattic's "Content Options" theme feature here? It allows you to show/hide specific elements. I'll attach a screenshot to show what I mean.

This ticket was mentioned in Slack in #meta-wordcamp by coreymckrill. View the logs.


3 days ago

Note: See TracTickets for help on using tickets.