Skip to content

Instantly share code, notes, and snippets.

/catlist-feed.php
Created Jun 23, 2016

Embed
What would you like to do?
<?php
/* Erzeugt eine Kategorieliste mit den RSS-Feed-Adressen der Kategorien */
function tb_categories_with_feed() {
$args = array(
'orderby' => 'name',
'feed' => 'RSS',
'echo' => false,
'title_li' => '',
);
$string .= '<ul>';
$string .= wp_list_categories($args);
$string .= '</ul>';
return $string;
}
// Shortcode erstellen
add_shortcode('categories-feed', 'tb_categories_with_feed');
// Filter hinzufügen, der die Shortcodes auch in Text-Widgets anzeigen lässt.
add_filter('widget_text', 'do_shortcode');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.