diff --git a/wp-content/themes/mediasanctuary/acf/group_67471a8d19703.json b/wp-content/themes/mediasanctuary/acf/group_67471a8d19703.json new file mode 100644 index 00000000..a5aced64 --- /dev/null +++ b/wp-content/themes/mediasanctuary/acf/group_67471a8d19703.json @@ -0,0 +1,80 @@ +{ + "key": "group_67471a8d19703", + "title": "HMM Special Episodes", + "fields": [ + { + "key": "field_67471a8d5b4cf", + "label": "Special Episode", + "name": "special_episode", + "aria-label": "", + "type": "true_false", + "instructions": "", + "required": 0, + "conditional_logic": 0, + "wrapper": { + "width": "", + "class": "", + "id": "" + }, + "message": "Special Episode (display with stories)", + "default_value": 0, + "allow_in_bindings": 0, + "ui_on_text": "", + "ui_off_text": "", + "ui": 1 + }, + { + "key": "field_67471af25b4d2", + "label": "Special Episode Title", + "name": "special_episode_title", + "aria-label": "", + "type": "text", + "instructions": "", + "required": 0, + "conditional_logic": [ + [ + { + "field": "field_67471a8d5b4cf", + "operator": "==", + "value": "1" + } + ] + ], + "wrapper": { + "width": "", + "class": "", + "id": "" + }, + "default_value": "", + "maxlength": "", + "allow_in_bindings": 0, + "placeholder": "", + "prepend": "", + "append": "" + } + ], + "location": [ + [ + { + "param": "post_type", + "operator": "==", + "value": "post" + }, + { + "param": "post_category", + "operator": "==", + "value": "category:hudson-mohawk-magazine-episodes" + } + ] + ], + "menu_order": 0, + "position": "normal", + "style": "default", + "label_placement": "top", + "instruction_placement": "label", + "hide_on_screen": "", + "active": true, + "description": "", + "show_in_rest": 0, + "modified": 1732713226 +} diff --git a/wp-content/themes/mediasanctuary/functions.php b/wp-content/themes/mediasanctuary/functions.php index deb9d92c..104710ec 100644 --- a/wp-content/themes/mediasanctuary/functions.php +++ b/wp-content/themes/mediasanctuary/functions.php @@ -320,9 +320,20 @@ function is_story_post($post) { return true; } } + $special_episode = get_field('special_episode', $post); + if (!empty($special_episode)) { + return true; + } return false; } +add_filter('the_title', function($title, $post) { + if (get_field('special_episode', $post)) { + return get_field('special_episode_title', $post); + } + return $title; +}, 10, 2); + add_action('pre_get_posts', function($query) { if ($query->is_main_query() && $query->get('post_type') == 'peoplepower') { if (empty($_GET['sort']) || $_GET['sort'] == 'recent') { @@ -358,13 +369,15 @@ function audio_player() { $feed_import_link = "Listen on SoundCloud"; } - $soundcloud_id = get_post_meta($post->ID, 'soundcloud_podcast_id', true); - if (! empty($soundcloud_id)) { - $sources[] = "/wp-json/soundcloud-podcast/v1/stream/$soundcloud_id"; - } - $soundcloud_url = get_post_meta($post->ID, 'soundcloud_podcast_url', true); - if (! empty($soundcloud_url)) { - $soundcloud_link = "Listen on SoundCloud"; + if (empty($feed_import_link)) { + $soundcloud_id = get_post_meta($post->ID, 'soundcloud_podcast_id', true); + if (! empty($soundcloud_id)) { + $sources[] = "/wp-json/soundcloud-podcast/v1/stream/$soundcloud_id"; + } + $soundcloud_url = get_post_meta($post->ID, 'soundcloud_podcast_url', true); + if (! empty($soundcloud_url)) { + $soundcloud_link = "Listen on SoundCloud"; + } } $internet_archive_id = get_post_meta($post->ID, 'internet_archive_id', true);