' . __( 'Direct script access denied.', 'articled') . '' ); } // Abu Array Keys Check if( ! function_exists( 'articled_ekey' ) ) { function articled_ekey($value = null, $array = null, $false = null) { if( isset($array) && is_array($array) && array_key_exists($value, $array) ) { return $array[$value]; } else { return $false; } } } if( ! function_exists( 'articled_numtype' ) ) { function articled_numtype( $number ){ $number = intval( $number ); if( $number % 2 == 0 ){ return "even"; } else { return "odd"; } } } if (!function_exists('clickable_date')) { function clickable_date() { $o = ''; $p = ' ' . get_the_date('M') . ''; $p = ' ' . get_the_date('j') . ','; $p = ' ' . get_the_date('Y') . ''; $o .= get_the_date(); $o .= ''; return $o; } } if( !function_exists('_html_decode') ) { function _html_decode($string) { return htmlspecialchars_decode( stripslashes_deep($string) ); } } if( !function_exists('_html_encode') ) { function _html_encode($string) { return htmlspecialchars( $string ); } } if ( !function_exists('articled_meta')): function articled_meta( $metaID ) { global $post; $get_value = get_post_meta($post->ID, $metaID, true); if ( $get_value == 'default' || $get_value == 'show' || $get_value == '') { $get_value = true; } elseif( $get_value == 'hide' ) { $get_value = false; } else{ $get_value = $get_value; } return $get_value; } endif; $get_articled_options = get_option('articled_options'); if ( ! function_exists('articled_options')): function articled_options($id) { global $get_articled_options; $output = _html_decode( articled_ekey( $id , $get_articled_options, false )); return articled_allowed_html_kses( $output ); } endif; if ( !function_exists('articled_mod')): function articled_mod($name, $default = false, $echo = false) { $output = get_theme_mod( $name, $default ); if($echo) { echo $output; } else { return $output; } } endif; if( !function_exists('articled_post_type')): function articled_post_type($post_id) { return get_post_format( $post_id ); } endif; if( !function_exists('articled_video_attachments') ) : function articled_video_attachments($videoID, $echo){ $video_url = wp_get_attachment_url($videoID); $video_e = ''; if($echo) { echo $video_e; } else { return $video_e; } } 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( __( 'Edit', 'articled' ), '', '', null, 'edit-post-link' ); echo ''.__( 'Delete', 'articled' ).']' ; }; } endif; if( ! function_exists('articled_remove_extr_space') ){ function articled_remove_extr_space($str, $echo = false){ if( $echo ) { echo trim( preg_replace( '/\s+/', ' ', $str ) ); } else { return trim( preg_replace( '/\s+/', ' ', $str ) ); } } } if( ! function_exists('articled_blog_post_layout') ){ function articled_blog_post_layout($type = null, $echo = true) { $is_sidebar = (intval(get_theme_mod('articled_blog_post_layout', '2')) % 2) == 0 ? true : false; if( $type == 'main' ) { if( $is_sidebar == 'even' ) { $o = 'col-md-9'; } else { $o = 'col-md-12'; } } elseif( $type == 'sidebar' ) { if ( $is_sidebar ) { $o = true; } else { $o = false; } } else { $o = ''; } if( $echo ) { echo esc_attr( $o ); } else { return $o ; } } } if( ! function_exists('articled_is_masonry') ){ function articled_is_masonry($place = null, $echo = true){ $o = null; $masonry = get_theme_mod('articled_blog_post_layout', '2'); if( $place == 'top' ) { if( $masonry == '6' || $masonry == '5' ) { $o = '
tags if( ! function_exists('articled_content_img_out_from_p') ){ function articled_content_img_out_from_p($content){ return preg_replace('/