thenewinquiry / tni-core-functionality

Contains the site's core functionality.
GNU General Public License v2.0
2 stars 0 forks source link

Post field for soundcloud url #29

Closed frnsys closed 6 years ago

frnsys commented 7 years ago

We started partnering with curio.io to record readings of TNI essays which they provide as a soundcloud link, e.g. https://soundcloud.com/curioio/the-new-inquiry-why-we-love/s-x6Jec. Can we add a field for this link? We aren't sure how we want to embed it yet but in any case that field would be necessary.

frnsys commented 7 years ago

hey @misfist, have you had a chance to look at this?

misfist commented 7 years ago

No, sorry, I completely missed this one. Adding a field is no problem. But, I did want to mention that WordPress has built-in support for many embeds, including SoundCloud. So, if you paste the URL into the content area, it will display as an embedded media file.

frnsys commented 7 years ago

oh cool - we haven't settled yet on the best way to display it yet and we want to be able to distinguish posts with these soundcloud links from those that don't (so we could, for instance, mark them with an icon or something)...i'm guessing to do that we'd need a separate field to check?

misfist commented 7 years ago

It could be done by checking the field. But, WordPress supports post formats, which is specifically for displaying posts differently based on content. One of the built-in formats is "audio" (An audio file or playlist. Could be used for Podcasting). This can be used to modify the mark-up by using get_post_format() in the template. Or, since format is included in the body class and post class, it can be used for styling.

body class:single-format-audio post class: format-standard

I enabled audio in the theme in case you want to make use of it. https://github.com/thenewinquiry/tni-theme/issues/76

https://codex.wordpress.org/Post_Formats