';
};
} else {
$o = ( ( $masonry == '6' || $masonry == '5' ) ? '' : '');
}
if( $echo ) echo $o ;
return esc_attr( $o );
}
}
if( ! function_exists('articled_title')){
function articled_title() {
echo '';
echo '';
echo '';
if( ! empty(get_the_title()) ) {
the_title();
} else {
echo '' . esc_html__( 'This Post has not Title', 'articled' ) . '';
}
echo '
';
echo '';
echo '';
return;
}
}
if ( ! function_exists( 'articled_clickable_date' ) ) {
function articled_clickable_date() {
$o = '';
$p = ' ' . esc_attr( get_the_date('M') ) . '';
$p = ' ' . esc_attr( get_the_date('j') ) . ',';
$p = ' ' . esc_attr( get_the_date('Y') ) . '';
$o .= esc_attr( get_the_date() );
$o .= '';
return $o;
}
}
if( !function_exists('articled_comments_count') ) :
function articled_comments_count( $comments_number = null ){
if( $comments_number == null) {
global $post;
$comments_number = get_comments_number( $post->ID);
} else {
$comments_number = $comments_number;
}
if($comments_number > 1) {
printf( _x('%1$s comments','plural comments','articled'), number_format_i18n( $comments_number ) );
} elseif ( $comments_number ) {
echo _x( 'One Comment', 'singular comment', 'articled' );
} else {
_e('No Comments', 'articled' );
}
}
endif;
// init actions for logged in user
if( !function_exists('articled_delete_post_url') ):
function articled_delete_post_url() {
// run only for single post page
if (is_single() && in_the_loop() && is_main_query() || is_home() || is_author() ) {
// add query arguments: action, post, nonce
$url = add_query_arg(array(
'action' => 'articled_delete_post',
'post' => get_the_ID(),
'nonce' => wp_create_nonce('articled_delete_post_nonce'),
),
home_url()
);
return esc_url($url);
}
return null;
}
endif;
if( !function_exists('articled_edit_delete_post') ) :
function articled_edit_delete_post(){
if( is_user_logged_in() && current_user_can( 'edit_posts' ) ) {
echo '[';
edit_post_link( sprintf( __( '%sEdit', 'articled' ), '' ) , '', '', null, 'edit-post-link' );
echo ''.__( 'Delete', 'articled' ).']' ;
};
}
endif;