• Resolved drperil

    (@drperil)


    Hey all,

    So I have the RSS feed truncated at 150 episodes but I’d like to make all of them available for download easily. Of course visitors can browse the archives but I was hoping to offer a list.

    I’ve created a short code. It displays the title/perma-link correctly but the “open in new window” link just spaws the same page in _blank, not a player window and the download link makes the page.html download, not the mp3. Any help would be greatly appreciated!

    
    /*
     * Output a simple unordered list of posts in a particular category by id with play and download links from PowerPress
     * Usage e.g.: [posts_in_category cat="721"]
     */
    function posts_in_category_func( $atts ) {
    
        $category_id = $atts['cat'];
        $args = array( 'category' => $category_id, 'post_type' =>  'post', 'numberposts' => -1, ); 
        $cat_posts = get_posts($args);
    	
        $markup = "<ul>";  
    
        foreach ($cat_posts as $post) {
    		$EpisodeData = powerpress_get_enclosure_data($post);
    		$MediaURL = powerpress_add_flag_to_redirect_url($EpisodeData['url'], ''); // This adds the play in page flag for Blubrry Statistics (optional)
    		$new_window_html = powerpressplayer_link_pinw('', $MediaURL, $EpisodeData);
    		$download_Link = powerpressplayer_link_download('', $MediaURL, $EpisodeData);
            
    		$markup .= "<li><a href='" . get_permalink($post->ID) . "'>" . $post->post_title . "</a> - " . $new_window_html . " - " . $download_Link . "</li>";
        }
    
        $markup .= "</ul>";
    
        return $markup;
    }
    add_shortcode( 'posts_in_category', 'posts_in_category_func' );
    
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Powerpress category play / download linkes’ is closed to new replies.