Last active
July 29, 2017 15:40
-
-
Save deryckoe/06745a4252b7ede06c99de4da6b13ce7 to your computer and use it in GitHub Desktop.
Agrega un RSS de noticias al Dashboard de WordPress
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 | |
/** | |
* Agrega un RSS de noticias al Dashboard de WordPress | |
*/ | |
function wpe_add_dashboard_widgets() { | |
wp_add_dashboard_widget( 'dashboard_custom_feed', 'Noticias de WP Expertos', 'wpe_rss_widget' ); | |
} | |
/** | |
* Conecta al RSS y muestra resultados en un widget | |
*/ | |
function wpe_rss_widget() { | |
echo '<div class="rss-widget">'; | |
wp_widget_rss_output(array( | |
'url' => 'https://wpexpertos.net/feed', | |
'title' => 'Noticias de WP Expertos', | |
'items' => 4, | |
'show_summary' => 1, | |
'show_author' => 0, | |
'show_date' => 1 | |
)); | |
echo "</div>"; | |
} | |
add_action('wp_dashboard_setup', 'wpe_add_dashboard_widgets'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment