Skip to content

Instantly share code, notes, and snippets.

Created June 23, 2016 13:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/777a06269e9abbb9a6f6d3e49a5389ef to your computer and use it in GitHub Desktop.
Save anonymous/777a06269e9abbb9a6f6d3e49a5389ef to your computer and use it in GitHub Desktop.
<?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