ID, $articled_post_option, true ); } else { $articled_post_options = true; } 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 = 'flase true'; $output = true; } elseif ( ( $articled_theme_options == true || $articled_theme_options == 1) && $articled_post_options == false ) { // $output = 'true false'; $output = false; } elseif ( ( $articled_theme_options == false || $articled_theme_options == 0 ) && $articled_post_options == false ) { // $output = 'false 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'); } } else { if(!$is_onside){ $content = 'col-md-10'; } 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('social_icon_loops')){ function 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 = get_the_post_thumbnail_url( get_the_ID(), $scr ); } else { $img_src = get_the_post_thumbnail_url( get_the_ID(), 'medium' ); } $img_data_data = get_the_post_thumbnail_url( get_the_ID(), $data_src ); $data_src_small = get_the_post_thumbnail_url( get_the_ID(), 'articled_data_src_small' ); $data_src_medium = get_the_post_thumbnail_url( get_the_ID(), 'articled_data_src_medium' ); $data_src_large = 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 = ''.$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 = wp_get_attachment_url( $default, $scr ); $img_data_data = wp_get_attachment_url( $default, $data_src); $data_src_small = wp_get_attachment_url( $default, 'articled_data_src_small' ); $data_src_medium = wp_get_attachment_url( $default, 'articled_data_src_medium' ); $data_src_large = 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 = ''.$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); } elseif (articled_options('articled_fb_comments_enabled') == 'on') { $response = wp_remote_get( 'https://graph.facebook.com/'.get_the_permalink() ); if ( is_array( $response ) && ! is_wp_error( $response ) ) { $headers = $response['headers']; // array of http header lines $body = $response['body']; // use the content } $body = json_decode($body, true); if(is_array($body)){ $comments_number = $body['share']['comment_count']; } } 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;