Opened 8 years ago
Closed 7 years ago
#1751 closed enhancement (fixed)
Allow Sponsor Shortcode to show excerpt, image only, or the_content
Reported by: | Kenshino | Owned by: | coreymckrill |
---|---|---|---|
Milestone: | Priority: | normal | |
Component: | WordCamp Site & Plugins | Keywords: | dev-feedback has-patch needs-testing |
Cc: |
Description
Right now the sponsor shortcode shows the_content and the title itself is not linked (check https://2016.singapore.wordcamp.org/sponsors/, you'll have to inspect to see the hidden title output)
The problem with this is that some sponsors are gonna have huge chunks of text and some aren't. So it's gonna look unequal, plus no one reads through that amount of text.
An excerpt will give us a good control of what to display on the archive page for sponsors. And the single page will allow people who actually want to read about them - to ... well do so.
I propose that the shortcode should do the following
- Allow excerpt=$length (length being a character limit that possibly hooks into excerpt_length filter, and when this is on, the_content is not ran)
- Allow both excerpts and content to be hidden to only show the sponsor image.
If it makes sense, I'll happily submit a patch :)
Attachments (2)
Change History (9)
#2
@
8 years ago
- Keywords needs-patch added
Adding context here from the discussion we had
https://wordpress.slack.com/archives/events/p1465226141000028
#3
@
7 years ago
- Keywords has-patch needs-testing added; needs-patch removed
I am currently at WordCamp Brightin Contributor Day and we found out, that the image is not using an alt attribute. So when you hide the content on the listings page, as we did for WordCamp Europe, screen readers will see no text (except headlines with sponsor levels) on the page. I've written a patch to add the sponsors title as the alt attributes text (1751-sponsors-alt.diff).
I also though about some of the points mentioned here about using excerpts instead of the full content. SO I came up with an idea, where you can be more fexible in how to design the page and also provide links to the single sponsors posts.
Currently, there is onyly one attribute link
with the values none
(default) and website
which will link to the sponsors external website. There is no option to link to the single sponsors post with the shortcode.
My second patch will add some new attributes (or values):
link
The default value none
will not link the title and logo. The current value website
will link both to the external sponsor website. The new value post
will link both to the single sponsors post.
title
The default value visible
will, show the h3
with the sponsors title, linked accordingly to the link
attribute
content
The default value full
will print the content. The value excerpt
will print the first 55 words of the content, adding a "continue reading" (with hidden screen reader title) at the end. Any other value, like none
, will hide the content, so only the logo and/or title will the shown.
excerpt_length
Sets the words to be used in the excerpt.
@andreamiddleton, I'm not entirely clear on the details of how the Community Team wants this to work.
55
words.Here's some counts on some current sponsors:
WooCommerce: 178 words, 1195 characters
Jetpack: 66 words, 459 characters
GoDaddy: 62 words, 416 characters
Bluehost: 78 words, 469 characters
WPML: 94 words, 602 characters
xref https://wordpress.slack.com/archives/events/p1465198114000016