public this repo is viewable by everyone
Description: A wordpress sidebar widget to show latest post from a specific category
Homepage: http://veilleperso.com
Clone URL: git://github.com/veilleperso/or_latests_posts.git
We show latests post only if we are on home, page or single post
veilleperso (author)
11 days ago
commit  cb9fbdbc396dfb9ef7cec5cbf7414137615533e0
tree    efdf8b843754dd84379beb31614a914eb6fb61b8
parent  f7d3307e3fdfef22eaebecfd251c08f428203c08
...
7
8
9
 
 
10
11
12
...
7
8
9
10
11
12
13
14
0
@@ -7,6 +7,8 @@ add_action('save_post', 'or_flush_latest_posts');
0
 add_action('deleted_post', 'or_flush_latest_posts');
0
 
0
 function or_latest_posts_widget($args, $widget_args = 1) {
0
+ if (!(is_home() || is_page() || is_single())) return '';
0
+
0
   extract( $args, EXTR_SKIP );
0
   if ( is_numeric($widget_args) ) $widget_args = array( 'number' => $widget_args );
0
   $widget_args = wp_parse_args( $widget_args, array( 'number' => -1 ) );

Comments

    No one has commented yet.