Skip to content

Instantly share code, notes, and snippets.

@TheCraigHewitt
TheCraigHewitt / .htaccess
Created July 27, 2019 17:27
Seriously Simple Podcasting: .htaccess line for FastCGI servers to enable password protection for feeds. This line to be added above the WordPress rules in the .htaccess file.
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
@TheCraigHewitt
TheCraigHewitt / functions.php
Last active December 6, 2021 12:34
Seriously Simple Podcasting: Add blog categories to podcast episodes (frontend).
add_action( 'pre_get_posts', 'ssp_add_podcast_to_category_archives' );
function ssp_add_podcast_to_category_archives( $query ){
if( is_admin() ) {
return;
}
if( $query->is_tax('category') || $query->is_category()) {
$query->set('post_type', array( 'post', 'podcast' ) );
}
@TheCraigHewitt
TheCraigHewitt / functions.php
Last active December 6, 2021 12:34
Seriously Simple Podcasting: Add blog categories to podcast episodes (admin).
add_action( 'init', 'ssp_add_categories_to_podcast', 15 );
function ssp_add_categories_to_podcast () {
register_taxonomy_for_object_type( 'category', 'podcast' );
}
@TheCraigHewitt
TheCraigHewitt / functions.php
Created July 27, 2019 17:34
Seriously Simple Podcasting: Modify podcast archive slug
add_filter( 'ssp_archive_slug', 'ssp_modify_podcast_archive_slug' );
function ssp_modify_podcast_archive_slug ( $slug ) {
return 'new-slug';
}
@TheCraigHewitt
TheCraigHewitt / functions.php
Created July 27, 2019 17:27
Seriously Simple Podcasting: Use raw audio file URL instead of custom rewrite
add_filter( 'ssp_episode_download_link', 'ssp_use_raw_audio_file_url', 10, 3 );
function ssp_use_raw_audio_file_url ( $url, $episode_id, $file ) {
return $file;
}
@TheCraigHewitt
TheCraigHewitt / functions.php
Created July 31, 2019 09:40
Seriously Simple Podcasting - Disable style sheet associated with RSS feed pages
<?php
add_filter( 'ssp_enable_rss_stylesheet', '__return_false' );
@TheCraigHewitt
TheCraigHewitt / functions.php
Created July 27, 2019 17:33
Seriously Simple Podcasting: Modify podcast feed slug
add_filter( 'ssp_feed_slug', 'ssp_modify_podcast_feed_slug' );
function ssp_modify_podcast_feed_slug ( $slug ) {
return 'new-slug';
}
@TheCraigHewitt
TheCraigHewitt / functions.php
Created July 27, 2019 17:32
Seriously Simple Podcasting: Modify number of episodes that appear in podcast RSS feed
add_filter( 'ssp_feed_number_of_posts', 'ssp_modify_number_of_posts_in_feed' );
function ssp_modify_number_of_posts_in_feed ( $n ) {
return 25; // Where 25 is the number of episodes that you would like to include in your RSS feed
}
@TheCraigHewitt
TheCraigHewitt / functions.php
Created July 27, 2019 17:32
Seriously Simple Podcasting: Switch off the use of post tags on podcast episodes
add_filter( 'ssp_use_post_tags', '__return_false' );
@TheCraigHewitt
TheCraigHewitt / function.php
Created July 27, 2019 17:30
Seriously Simple Podcasting: Get audio player for specific episode.
global $ss_podcasting;
$audio_player = $ss_podcasting->episode_meta( $episode_id );