Created
June 23, 2016 13:06
-
-
Save anonymous/777a06269e9abbb9a6f6d3e49a5389ef to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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