Plugin Directory

Changeset 140179


Ignore:
Timestamp:
07/28/2009 06:50:52 PM (17 years ago)
Author:
mstegink
Message:

Added shortcode

Location:
charted-archives/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • charted-archives/trunk/ChartedArchives.php

    r140073 r140179  
    44Plugin URI: http://www.bos89.nl/wordpress-charted-archives-plugin/
    55Description: Show your archives by month in a bar chart, after an idea from John Nunemaker.
    6 Version: 1.0
     6Version: 1.2
    77Author: M. Stegink
    88Author URI: http://www.bos89.nl/
     
    7777}
    7878
     79// Shortcode, has number of months as argument
     80
     81function chartedarchive_shortcode($attr) {
     82    return Charted_Archives($attr['months']);
     83}
     84add_shortcode('chartedarchive', 'chartedarchive_shortcode');
     85
    7986// register Charted_Archives widget and add CSS
    8087add_action('wp_head', 'Charted_Archives_CSS');
  • charted-archives/trunk/readme.txt

    r140073 r140179  
    1414== Installation ==
    1515
     16You can use this in three ways
     17
     18= 1. As a widget =
     19
    16201. Upload the plugin to your blog an Activate it
    17212. Go to Themes > Widgets and add the widget
    1822
    19 You can also insert it in a page using the tag
    20 <?php Charted_Archives($number_of_months_to_show) ?>
     23= 2. As a php tag in a template =
     24
     25Just insert it the tag
     26Charted_Archives($number_of_months_to_show);
     27
     28= 3. With the shortcode in a page =
     29If you do not want to add php to your page you can use a shortcode
     30
     31[chartedarchive] (defaults to 7 months)
     32[chartedarchive months="12"] (where 12 can be any number of months)
    2133
    2234== Screenshots ==
     
    3446* Fixed CSS file link error
    3547* Updated readme to reflect php tag
     48
     49= 1.2 =
     50
     51* Added a shortcode on user request
Note: See TracChangeset for help on using the changeset viewer.