'widget_post_meta', 'description' => __( 'Use only for single template' , 'cannyon' ) )); } function widget( $args, $instance ) { global $post; /* PRINT THE WIDGET */ extract( $args , EXTR_SKIP ); $instance = wp_parse_args( (array) $instance, array( 'title' => '' )); $title = $instance[ 'title' ]; if( !is_single() ){ return; } echo $before_widget; if( !empty( $title ) ) { echo $before_title; echo apply_filters( 'widget_title', esc_attr( $title ), $instance, $this -> id_base ); echo $after_title; } $y = esc_attr( get_post_time( 'Y', false, $post -> ID ) ); $m = esc_attr( get_post_time( 'm', false, $post -> ID ) ); $d = esc_attr( get_post_time( 'd', false, $post -> ID ) ); $name = get_the_author_meta( 'display_name' , $post -> post_author ); $dtime = get_post_time( 'Y-m-d', false, $post -> ID ); $ptime = get_post_time( esc_attr( get_option( 'date_format' ) ), false , $post -> ID, true ); echo '
'; echo ''; echo '
'; echo $after_widget; } function update( $new_instance, $old_instance ) { /* UPATE THE WIDGET OPTIONS */ $instance = $old_instance; $instance[ 'title' ] = esc_attr( strip_tags( $new_instance[ 'title' ] ) ); return $instance; } function form( $instance ) { /* PRINT WIDGET FORM */ $instance = wp_parse_args( (array) $instance, array( 'title' => '' )); $title = $instance[ 'title' ]; echo '

'; echo ''; echo '

'; } } register_widget( 'mythemes_post_meta' ); } /* END IF CLASS EXISTS */ ?>