' . __( 'Direct script access denied.', 'articled') . '' ); } if( !function_exists('articled_comb_options') ) : function articled_comb_options($articled_theme_option = null, $articled_post_option = null, $default_mod = true, $echoing = null){ global $post; $articled_theme_options = get_theme_mod( $articled_theme_option, $default_mod ); if( class_exists( 'articled_post_meta' ) ) { // plugin territory $articled_post_options = get_post_meta( $post->ID, $articled_post_option, true ); } else { $articled_post_options = 'default'; } if ( $articled_post_options == 'show') { $articled_post_options = true; } elseif ( $articled_post_options == '' || $articled_post_options == 'default' ) { $articled_post_options = $articled_theme_options; } else { $articled_post_options = false; } if ( ( $articled_theme_options == false || $articled_theme_options == 0 ) && $articled_post_options == true ) { $output = true; } elseif ( ( $articled_theme_options == true || $articled_theme_options == 1) && $articled_post_options == false ) { $output = false; } elseif ( ( $articled_theme_options == false || $articled_theme_options == 0 ) && $articled_post_options == false ) { $output = false; } else { $output = true; } // return output final boolen if ( $echoing ) { echo '' . $output; } return $output; } endif; if( !function_exists('articled_single_sidebar') ) : function articled_single_sidebar($is_onside = false) { global $post; $articled_theme_options = get_theme_mod( 'articled_single_post_sibebar', 'show-right' ); $articled_post_options = get_post_meta( $post->ID, 'articled_sidebar_meta_options', true ); if( $articled_theme_options == 'show-right' || $articled_theme_options == '') { if(!$is_onside){ $content = 'col-md-9'; } else { $content = 'col-md-3'; } } elseif($articled_theme_options == 'show-left' && ($articled_post_options == 'show_left' || $articled_post_options == '' || $articled_post_options == 'default' ) ) { if(!$is_onside){ $content = 'col-md-9'; } else { $content = 'col-md-3 left-mod'; } if( !function_exists('articled_single_post_sibebar_on_left') ){ function articled_single_post_sibebar_on_left(){ echo ''; } add_action( 'wp_footer', 'articled_single_post_sibebar_on_left', 999 ); } } else { if(!$is_onside){ $content = 'col-md-11'; } else { $content = false; } } if( $articled_post_options == 'default' || $articled_post_options == '') { $final_output = $content; } elseif ( $articled_post_options == 'hide' ) { if(!$is_onside){ $final_output = 'col-md-12'; } else { $final_output = false; } } elseif ( $articled_post_options == 'show_right' ) { if(!$is_onside){ $final_output = 'col-md-9'; } else { $final_output = 'col-md-3'; } } elseif ( $articled_post_options == 'show_left' ) { if(!$is_onside){ $final_output = 'col-md-9'; } else { $final_output = 'col-md-3 left-meta'; } add_action('wp_footer', function(){ echo ''; }); } else { if(!$is_onside){ $final_output = 'col-md-9'; } else { $final_output = 'col-md-3'; } } return $final_output; } endif; if(!function_exists('articled_social_icon_loops')){ function articled_social_icon_loops() { $nadas = array( 'facebook' => array( 'url' => get_theme_mod( 'articled_facebook_url', ''), 'class' => ' fa-facebook scrb-facebook ', ), 'twitter' => array( 'url' => get_theme_mod( 'articled_twitter_url'), 'class' => ' fa-twitter-square scrb-twitter ', ), 'youtube' => array( 'url' => get_theme_mod( 'articled_youtube_url'), 'class' => ' fa-youtube scrb-youtube ', ), 'instagram' => array( 'url' => get_theme_mod( 'articled_instagram_url'), 'class' => ' fa-instagram scrb-instagram ', ), 'pinterest' => array( 'url' => get_theme_mod( 'articled_pinterest_url'), 'class' => ' fa-pinterest scrb-pinterest ', ), 'google' => array( 'url' => get_theme_mod( 'articled_google_plus_url'), 'class' => ' fa-google-plus scrb-google ', ), ); foreach($nadas as $key ){ if(!empty($key['url'])){ echo '' . '' . ''; } } } } // Thumbnail Images function_exists if( !function_exists('articled_classic_thumbnail') ) : function articled_classic_thumbnail( $data_src = 'thumbnail', $scr = 'thumbnail', $default = null) { if( has_image_size( $scr )){ $img_src = esc_url( get_the_post_thumbnail_url( get_the_ID(), $scr ) ); } else { $img_src = esc_url( get_the_post_thumbnail_url( get_the_ID(), 'medium' ) ); } $img_data_data = esc_url( get_the_post_thumbnail_url( get_the_ID(), $data_src ) ); $data_src_small = esc_url( get_the_post_thumbnail_url( get_the_ID(), 'articled_data_src_small' ) ); $data_src_medium = esc_url( get_the_post_thumbnail_url( get_the_ID(), 'articled_data_src_medium' ) ); $data_src_large = esc_url( get_the_post_thumbnail_url( get_the_ID(), 'articled_data_src_large' ) ); if ( !$default = null ) { $thumbnail = $default; } $img_title = get_the_title( get_post_thumbnail_id() ); $img_alt = get_post_meta( get_post_thumbnail_id(), '_wp_attachment_image_alt', true ); if(!empty($img_alt)){ $img_alt = $img_alt; } else { $img_alt = $img_title; } if ( has_post_thumbnail() && strlen(get_the_post_thumbnail()) ) { // If Post has Thumbnail $thumbnail = ''.esc_attr( $img_alt ).'' .'' .''; } else { // If, It is not page if(!is_page()){ // If Post doesn't has Thumbnail, then SHow default Images $thumbnail = ''; } } // return final thumnail to echo out return $thumbnail; } endif; // Thumbnail Images function_exists if( !function_exists('articled_gallery_images') ) : function articled_gallery_images( $data_src = 'thumbnail', $scr = 'thumbnail', $default) { $img_src = esc_url( wp_get_attachment_url( $default, $scr ) ); $img_data_data = esc_url( wp_get_attachment_url( $default, $data_src) ); $data_src_small = esc_url( wp_get_attachment_url( $default, 'articled_data_src_small' ) ); $data_src_medium =esc_url( wp_get_attachment_url( $default, 'articled_data_src_medium' ) ); $data_src_large = esc_url( wp_get_attachment_url( $default, 'articled_data_src_large' ) ); $img_title = get_the_title($default); $img_alt = get_post_meta($default, '_wp_attachment_image_alt', true); if(!empty($img_alt)){ $img_alt = $img_alt; } else { $img_alt = $img_title; } $thumbnail = '' . esc_attr( $img_alt ) . '' .'' .''; return $thumbnail; } endif; 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;