Yesterday I pushed to the WordPress repository a new version of my plugin Delicious Readings. If you don’t know this plugin, Delicious Readings lets you publish on your blog a collection of Delicious bookmarks stored with a particular tagged of your choice. So, for example, you can publish your bookmarks stored under “readings” or “pets” or “sushi” and so on.
The new version 2.0 adds the shortcode, in order to publish this list on a page or on a post. The idea comes from a user on the WordPress forums, who asked if there were the possibility to publish this list on a page rather than on a widget in the sidebar (already full of stuff). I was replying that he could call the plugin’s main function directly in the PHP code, but I thought it were better to add a shortcode for use in the writing panel.
Usage as shortcode
The shortcode accepts the full range of options of the core function. The only mandatory option is the address of the feed. So, for example, if your username is joe and the tag is books the shortcode will be:
|
|
[dreadings feed_url="http://delicious.com/v2/rss/joe/books"] |
The plugin will show the last 5 bookmarks by default. If you want to show 10 bookmarks, change the shortcode as follows:
|
|
[dreadings feed_url="http://delicious.com/v2/rss/joe/books" quantity=10] |
The tags aren’t displayed by default. If you want to show them, change the line in this way:
|
|
[dreadings feed_url="http://delicious.com/v2/rss/joe/books" quantity=10 display_tags=true] |
This is the full set of options you can use (the value shown here is the default one):
|
|
feed_url="" quantity=5 display_desc=false truncate=0 display_date=false date_text="Stored on:" display_tags=false tags_text="Tags:" display_hashtag=true display_arrow=false display_archive=true archive_text="More posts" display_arch_arr=true new_tab=false nofollow=true |
Usage as PHP function
As I already said, you can use the plugin calling the main function directly in your PHP files:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
|
<?php if ( function_exists( 'dr_fetch_feed' ) ) { $args = array( 'feed_url' => '', 'quantity' => 5, 'display_desc' => false, 'truncate' => 0, 'display_date' => false, 'date_text' => 'Stored on:', 'display_tags' => false, 'tags_text' => 'Tags:', 'display_hashtag' => true, 'display_arrow' => false, 'display_archive' => true, 'archive_text' => 'More posts', 'display_arch_arr' => true, 'new_tab' => false, 'nofollow' => true, ); dr_fetch_feed( $args ); } ?> |
Make sure to check if the opening <?php and closing ?> PHP tags are needed in your code. This is the full range of options — you can obviously use only those who need change.
The plugin is available on the WordPress repository and on GitHub.
Like this:
Like Loading...
Jacki 11:45 pm on February 20, 2013 Permalink |
Private content 2.1 works perfectly ! Merci beaucoup, aldolat.
aldolat 7:57 am on February 26, 2013 Permalink |
You’re welcome!