Advertisement
Beee

Custom post views

Oct 22nd, 2017
371
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.88 KB | None | 0 0
  1. function custom_pvc_counter_function( $arguments ) {
  2.     $arguments = shortcode_atts( array(
  3.         'number' => '10',
  4.         'post_type' => array('post', 'page'),
  5.         'order' => 'DESC',
  6.     ), $arguments );
  7.  
  8.  
  9.     $defaults = array(
  10.         'number_of_posts'        => $arguments['number'],
  11.         'post_type'              => $arguments['post_type'],
  12.         'order'                  => $arguments['order'],
  13.         'thumbnail_size'         => 'thumbnail',
  14.         'show_post_views'        => true,
  15.         'show_post_thumbnail'    => false,
  16.         'show_post_excerpt'      => false,
  17.         'no_posts_message'       => __( 'No Posts', 'post-views-counter' ),
  18.         'item_before'            => '',
  19.         'item_after'             => ''
  20.     );
  21.  
  22.     return pvc_most_viewed_posts( $defaults );
  23.  
  24. }
  25. add_shortcode( 'custom-post-views', 'custom_pvc_counter_function' );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement