A shortcode in WordPress is a small piece of code, surrounded by square brackets (e.g. [shortcode]), that you can add to your posts, pages, or other content types to display dynamic content. Shortcodes are a way of “packaging” complex functionality into a simple, reusable code snippet.
For example, podcast player plugin provides a shortcode that displays your desired podcast. To use the shortcode, you simply add it to your content where you want the content to appear. The shortcode is then replaced by the dynamic content when the page is displayed.
Here are the steps to add a shortcode to a WordPress post or page:
- Edit a post or page: Go to Posts > Add New or Pages > Add New in the WordPress dashboard to create a new post or edit an existing one.
- Add the shortcode: In the WordPress editor, place your cursor where you want the shortcode to appear, and then add the shortcode by typing or pasting the following into the editor.
[podcastplayer feed_url="YOUR_FEED_URL"]
In the above code, replace YOUR_FEED_URL with your actual feed url.
- Save or publish: When you’re done, click the “Publish” or “Update” button to save your changes and make your content live.
Customize podcast player shortcode
You can optionally add other attributes to your shortcode to customize the player. An example is as follows,
[podcastplayer feed_url="YOUR_FEED_URL" attribute="ATTRIBUTE_VALUE"]
- All available shortcode attributes and their expected values are provided in the table below. You can enter as many attributes as required in the shortcode.
- An example for the podcast player shortcode with attributes is as follows,
[podcastplayer feed_url="https://vedathemes.com/feed/podcast" display_style="modern" accent_color="#347657" number="5"]
Podcast player shortcode Attributes
For advanced setup, there are many shortcode parameters you can use to customise display of your podcast player. Shortcode parameters mentioned in above example is just for demonstration purpose. You may NOT need to use all of the parameters mentioned in below table, just use whatever is required to achieve a particular customization.
Complete list of parameters is as below,
Minimum required attributes
Attribute | Default Value | Description |
---|---|---|
feed_url | ” | Your podcast feed url |
Customize Podcast Content
Attribute | Default Value | Description |
---|---|---|
cover_image_url | ” | Your Podcast’s cover image url |
podcast_menu | ” | Any WordPress menu’s name, ID OR slug |
main_menu_items | 0 | Number of primary menu items for which badge or button is to be displayed. |
number | 10 | Number of podcasts episodes to be displayed at a time |
excerpt_length | 18 | Excerpt length (only with default and premium display style) |
Podcast Subscription Links
Attribute | Default Value | Description |
---|---|---|
apple_sub | ” | Apple podcast subscription link |
google_sub | ” | Google podcast subscription link |
spotify_sub | ” | Spotify podcast subscription link |
breaker_sub | ” | Breaker subscription link |
castbox_sub | ” | Castbox subscription link |
castro_sub | ” | Castro subscription link |
iheart_sub | ” | iHeart subscription link |
overcast_sub | ” | Overcast subscription link |
castbox_sub | ” | Castbox subscription link |
pocketcasts_sub | ” | Pocketcasts subscription link |
podcastaddict_sub | ” | Podcastaddict subscription link |
podchaser_sub | ” | Podchaser subscription link |
radiopublic_sub | ” | Radiopublic subscription link |
soundcloud_sub | ” | Soundcloud subscription link |
stitcher_sub | ” | Stitcher subscription link |
tunein_sub | ” | Tunein subscription link |
youtube_sub | ” | YouTube subscription link |
bullhorn_sub | ” | BullHorn subscription link |
podbean_sub | ” | Podbean subscription link |
playerfm_sub | ” | PlayerFM subscription link |
Show / Hide Player Items
Attribute | Default Value | Description |
---|---|---|
header_default | false | Show player header items by default |
list_default | false | Display Episodes list by default on small screen |
hide_header | false | Hide player header items |
hide_title | false | Show / Hide podcast Title in header info section |
hide_cover | false | Show / Hide podcast cover image |
hide_description | false | Show / Hide podcast description |
hide_subscribe | false | Show / Hide podcast subscribe button |
hide_search | false | Show / Hide podcast search field |
hide_author | false | Show / Hide author/podcaster’s name |
hide_content | false | Show / Hide podcast episode’s content |
hide_loadmore | false | Show / Hide podcast load more button |
hide_download | false | Show/ Hide podcast episode download link |
hide_social | false | Show/ Hide podcast episode social sharing links |
hide_featured | false | Hide podcast episode featured image (Value: true OR false) |
Podcast player styling
Attribute | Default Value | Description |
---|---|---|
accent_color | #65b84f | Podcast player’s accent color hexcode |
display_style | ” | Podcast player display style. Options: ” (for default view OR do not use this attribute), legacy (for legacy view), modern (for Modern Layout) |
Sort & Filter options
Attribute | Default Value | Description |
---|---|---|
sortby | sort_date_desc | Sort episodes (Available options: sort_date_desc, sort_date_asc, sort_title_desc, sort_title_asc) |
filterby | ” | Filter by any string in episode’s title |