[post_media_transcript]

The shortcode designed to generatea link to a media transcript or a featured image, depending on the post format.


Product


Shortcode Attributes

There are a number of shortcode attributes available which you can use to customize the output.

  1. id – The ID of the post.
    • Default: The current post ID.
    • Options: Any numeric value.
  2. url – A custom URL to override the default transcript URL or featured image URL.
    • Options: Any URl.
  3. classes – Additional CSS classes to apply to the download link.

Shortcode Enclosed Content

Any content placed between [post_media_transcript] and [/post_media_transcript] will be used as a template, where {content} acts as a placeholder for the post description.


Example Usage

Example 1

[post_media_transcript]

Results

<a class="transcript-link" href="https://example.com/featured-image.jpg" target="_blank">View Transcript</a>
This example generate a link to the transcript or featured image of the current post with the default text “View Transcript”.
The link generated by the shortcode will open in a new tab (target="_blank")

Example 2

[post_media_transcript id="456" classes="btn btn-primary"]Read Transcript[/post_media_transcript]

Results

<a class="transcript-link btn btn-primary" href="https://example.com/custom-media-file.png" target="_blank">Read Transcript</a>
This example generates a link to the transcript or featured image of the post with ID 456, using the text “Read Transcript” and applying the CSS classes btn and btn-primary.

Example 3

[post_media_transcript url="https://example.com/custom-transcript.pdf"]Download Transcript[/post_media_transcript]

Results

<a class="transcript-link" href="https://example.com/custom-transcript.pdf" target="_blank">Download Transcript</a>
That example generates a link to the custom URL provided, with the text “Download Transcript”.