ID; // ... get ALL posts (per default sorted by post_date), ... $posts = get_posts('author='.$ID); $post_dates[$ID] = ''; // ... then use only the first (= newest) post if ($posts) $post_dates[$ID] = $posts[0]->post_date; } } // Sort dates (according to order), ... if (! $asc) arsort($post_dates); // ... then set up user array $users = array(); foreach ($post_dates as $key => $value) { // $user = get_userdata($key); // $users[] = $user->ID; $users[] = get_userdata($key); } return $users; } // Profil Resmi Yükleme add_action( 'show_user_profile', 'show_extra_profile_fields', 10 ); add_action( 'edit_user_profile', 'show_extra_profile_fields', 10 ); function show_extra_profile_fields( $user ) { ?>

query_vars['paged'] > 1 ? $current = $wp_query->query_vars['paged'] : $current = 1; $sayfalar = array('base' => @add_query_arg('paged','%#%'),'total' => $wp_query->max_num_pages,'current' => $current,); echo paginate_links($sayfalar); } /** * HaberMatik Meta boxAdds a box to the main column on the Post add/edit screens. */ function habermatik_add_meta_box() { add_meta_box( 'habermatik_sectionid', 'Haber Özelliği', 'habermatik_meta_box_callback', 'post' ); //you can change the 4th paramter i.e. post to custom post type name, if you want it for something else } add_action( 'add_meta_boxes', 'habermatik_add_meta_box' ); /** * Prints the box content. * * @param WP_Post $post The object for the current post/page. */ function habermatik_meta_box_callback( $post ) { // Add an nonce field so we can check for it later. wp_nonce_field( 'habermatik_meta_box', 'habermatik_meta_box_nonce' ); /* * Use get_post_meta() to retrieve an existing value * from the database and use the value for the form. */ $hmvalue = get_post_meta( $post->ID, 'haberozelligi_key', true ); //my_key is a meta_key. Change it to whatever you want ?>
>Sürmanşet
>Manşet
>Öne Çıkan
>Yan Haber
ID, "mvp_post_template", true); if( ( empty($mvp_post_temp) && $mvp_post_layout == '1' ) || ( $mvp_post_temp == "def" && $mvp_post_layout == '1' ) || ( empty($mvp_post_temp) && $mvp_post_layout == '7' ) || ( $mvp_post_temp == "def" && $mvp_post_layout == '7' ) || ( $mvp_post_temp == "global" && $mvp_post_layout == '1' ) || ( $mvp_post_temp == "global" && $mvp_post_layout == '7' ) || $mvp_post_temp == "temp2" || $mvp_post_temp == "temp8" ) { $mvp_post_side_css = " .single .mvp-post-main-out, .single .mvp-post-main-in { margin-left: 0 !important; } #mvp-post-feat-img img { width: 100%; } #mvp-content-wrap, #mvp-post-add-box { float: none; margin: 0 auto; max-width: 750px; } "; } } } else { global $post; if (!empty( $post )) { $mvp_post_layout = get_option('mvp_post_layout'); $mvp_post_temp = get_post_meta($post->ID, "mvp_post_template", true); if( ( empty($mvp_post_temp) && $mvp_post_layout == '1' ) || ( $mvp_post_temp == "def" && $mvp_post_layout == '1' ) || ( empty($mvp_post_temp) && $mvp_post_layout == '7' ) || ( $mvp_post_temp == "def" && $mvp_post_layout == '7' ) || ( $mvp_post_temp == "global" && $mvp_post_layout == '1' ) || ( $mvp_post_temp == "global" && $mvp_post_layout == '7' ) || $mvp_post_temp == "temp2" || $mvp_post_temp == "temp8" ) { $mvp_post_side_css = " .single .mvp-post-main-out, .single .mvp-post-main-in { margin-right: 0 !important; } #mvp-post-feat-img img { width: 100%; } #mvp-content-wrap, #mvp-post-add-box { float: none; margin: 0 auto; max-width: 750px; } "; } } } $mvp_rtl = get_option('mvp_rtl'); if ($mvp_rtl == "true") { global $post; if (!empty( $post )) { $mvp_post_layout = get_option('mvp_post_layout'); $mvp_post_temp = get_post_meta($post->ID, "mvp_post_template", true); if( ( empty($mvp_post_temp) && $mvp_post_layout == '3' ) || ( $mvp_post_temp == "def" && $mvp_post_layout == '3' ) || ( empty($mvp_post_temp) && $mvp_post_layout == '5' ) || ( $mvp_post_temp == "def" && $mvp_post_layout == '5' ) || ( $mvp_post_temp == "global" && $mvp_post_layout == '3' ) || ( $mvp_post_temp == "global" && $mvp_post_layout == '5' ) || $mvp_post_temp == "temp4" || $mvp_post_temp == "temp6" ) { $mvp_post_side2_css = " .single .mvp-post-main-out, .single .mvp-post-main-in { margin-left: 0 !important; } #mvp-post-feat-img img { width: 100%; } #mvp-post-content, #mvp-post-add-box { float: none; margin: 0 auto; max-width: 750px; } "; } } } else { global $post; if (!empty( $post )) { $mvp_post_layout = get_option('mvp_post_layout'); $mvp_post_temp = get_post_meta($post->ID, "mvp_post_template", true); if( ( empty($mvp_post_temp) && $mvp_post_layout == '3' ) || ( $mvp_post_temp == "def" && $mvp_post_layout == '3' ) || ( empty($mvp_post_temp) && $mvp_post_layout == '5' ) || ( $mvp_post_temp == "def" && $mvp_post_layout == '5' ) || ( $mvp_post_temp == "global" && $mvp_post_layout == '3' ) || ( $mvp_post_temp == "global" && $mvp_post_layout == '5' ) || $mvp_post_temp == "temp4" || $mvp_post_temp == "temp6" ) { $mvp_post_side2_css = " .single .mvp-post-main-out, .single .mvp-post-main-in { margin-right: 0 !important; } #mvp-post-feat-img img { width: 100%; } #mvp-post-content, #mvp-post-add-box { float: none; margin: 0 auto; max-width: 750px; } "; } } } if ( is_single() ) { $mvp_rtl = get_option('mvp_rtl'); if ($mvp_rtl == "true") { global $post; if (!empty( $post )) { $mvp_post_layout = get_option('mvp_post_layout'); $mvp_post_temp = get_post_meta($post->ID, "mvp_post_template", true); if( ( empty($mvp_post_temp) && $mvp_post_layout == '4' ) || ( $mvp_post_temp == "def" && $mvp_post_layout == '4' ) || ( empty($mvp_post_temp) && $mvp_post_layout == '5' ) || ( $mvp_post_temp == "def" && $mvp_post_layout == '5' ) || ( $mvp_post_temp == "global" && $mvp_post_layout == '4' ) || ( $mvp_post_temp == "global" && $mvp_post_layout == '5' ) || $mvp_post_temp == "temp5" || $mvp_post_temp == "temp6" ) { $mvp_post_side3_css = " .mvp-nav-soc-wrap { margin-top: -15px; height: 30px; } span.mvp-nav-soc-but { font-size: 16px; padding-top: 7px; width: 30px; height: 23px; } #mvp-main-nav-top { padding: 10px 0 !important; height: 30px !important; z-index: 9999; } .mvp-nav-top-wrap, .mvp-nav-top-mid { height: 30px !important; } .mvp-nav-top-mid img { height: 100% !important; } #mvp-main-nav-bot { border-bottom: none; display: none; height: 0; } .mvp-nav-top-mid img { margin-right: 0; } .mvp-nav-top-left-out { margin-right: -200px; } .mvp-nav-top-left-in { margin-right: 200px; } .mvp-nav-top-left { display: block; } "; } } } else { global $post; if (!empty( $post )) { $mvp_post_layout = get_option('mvp_post_layout'); $mvp_post_temp = get_post_meta($post->ID, "mvp_post_template", true); if( ( empty($mvp_post_temp) && $mvp_post_layout == '4' ) || ( $mvp_post_temp == "def" && $mvp_post_layout == '4' ) || ( empty($mvp_post_temp) && $mvp_post_layout == '5' ) || ( $mvp_post_temp == "def" && $mvp_post_layout == '5' ) || ( $mvp_post_temp == "global" && $mvp_post_layout == '4' ) || ( $mvp_post_temp == "global" && $mvp_post_layout == '5' ) || $mvp_post_temp == "temp5" || $mvp_post_temp == "temp6" ) { $mvp_post_side3_css = " .mvp-nav-soc-wrap { margin-top: -15px; height: 30px; } span.mvp-nav-soc-but { font-size: 16px; padding-top: 7px; width: 30px; height: 23px; } #mvp-main-nav-top { padding: 10px 0 !important; height: 30px !important; z-index: 9999; } .mvp-nav-top-wrap, .mvp-nav-top-mid { height: 30px !important; } .mvp-nav-top-mid img { height: 100% !important; } #mvp-main-nav-bot { border-bottom: none; display: none; height: 0; } .mvp-nav-top-mid img { margin-left: 0; } .mvp-nav-top-left-out { margin-left: -200px; } .mvp-nav-top-left-in { margin-left: 200px; } .mvp-nav-top-left { display: block; } "; } } } } $mvp_alp = get_option('mvp_alp'); $mvp_alp_side = get_option('mvp_alp_side'); if ($mvp_alp == "true") { if (isset($mvp_alp)) { if ($mvp_alp_side == "0") { $mvp_alp_css = " .mvp-auto-post-grid { grid-template-columns: 340px minmax(0, auto); } "; } else if ($mvp_alp_side == "1") { $mvp_alp_css = " .mvp-alp-side { display: none; } .mvp-alp-soc-reg { display: block; } .mvp-auto-post-grid { grid-template-columns: minmax(0, auto) 320px; grid-column-gap: 60px; } @media screen and (max-width: 1199px) { .mvp-auto-post-grid { grid-column-gap: 30px; } } "; } else { $mvp_alp_css = " .mvp-alp-side { display: none; } .mvp-alp-soc-reg { display: block; } .mvp-auto-post-grid { grid-template-columns: 100%; margin: 30px auto 0; max-width: 1000px; } .mvp-auto-post-main #mvp-content-body { float: none; margin: 0 auto; max-width: 740px; } "; } } } $mvp_alp_ad = get_option('mvp_alp_ad'); if ( ! $mvp_alp_ad) { $mvp_alp_side_ad_css = " .alp-advert { display: none; } .alp-related-posts-wrapper .alp-related-posts .current { margin: 0 0 10px; } "; } if ($mvp_customcss) { $mvp_customcss_css = " $mvp_customcss "; } if (isset($mvp_theme_options)) { wp_kses_post(wp_add_inline_style( 'mvp-custom-style', $mvp_theme_options )); } if (isset($mvp_wall_ad_css)) { wp_kses_post(wp_add_inline_style( 'mvp-custom-style', $mvp_wall_ad_css )); } if (isset($mvp_prime_skin_css)) { wp_kses_post(wp_add_inline_style( 'mvp-custom-style', $mvp_prime_skin_css )); } if (isset($mvp_site_skin_css)) { wp_kses_post(wp_add_inline_style( 'mvp-custom-style', $mvp_site_skin_css )); } if (isset($mvp_nav_skin_css)) { wp_kses_post(wp_add_inline_style( 'mvp-custom-style', $mvp_nav_skin_css )); } if (isset($mvp_nav_layout_css)) { wp_kses_post(wp_add_inline_style( 'mvp-custom-style', $mvp_nav_layout_css )); } if (isset($mvp_para_lead_css)) { wp_kses_post(wp_add_inline_style( 'mvp-custom-style', $mvp_para_lead_css )); } if (isset($mvp_infinite_scroll_css)) { wp_kses_post(wp_add_inline_style( 'mvp-custom-style', $mvp_infinite_scroll_css )); } if (isset($mvp_respond_css)) { wp_kses_post(wp_add_inline_style( 'mvp-custom-style', $mvp_respond_css )); } if (isset($mvp_cont_read_css)) { wp_kses_post(wp_add_inline_style( 'mvp-custom-style', $mvp_cont_read_css )); } if (isset($mvp_post_side_css)) { wp_kses_post(wp_add_inline_style( 'mvp-custom-style', $mvp_post_side_css )); } if (isset($mvp_post_side2_css)) { wp_kses_post(wp_add_inline_style( 'mvp-custom-style', $mvp_post_side2_css )); } if (isset($mvp_post_side3_css)) { wp_kses_post(wp_add_inline_style( 'mvp-custom-style', $mvp_post_side3_css )); } if (isset($mvp_alp_css)) { wp_kses_post(wp_add_inline_style( 'mvp-custom-style', $mvp_alp_css )); } if (isset($mvp_alp_side_ad_css)) { wp_kses_post(wp_add_inline_style( 'mvp-custom-style', $mvp_alp_side_ad_css )); } if (isset($mvp_customcss_css)) { wp_kses_post(wp_add_inline_style( 'mvp-custom-style', $mvp_customcss_css )); } } } add_action( 'wp_enqueue_scripts', 'mvp_styles_method' ); ///////////////////////////////////// // Enqueue Javascript/CSS Files ///////////////////////////////////// if ( ! function_exists( 'mvp_scripts_method' ) ) { function mvp_scripts_method() { global $wp_styles; wp_enqueue_style( 'mvp-reset', get_template_directory_uri() . '/css/reset.css' ); wp_enqueue_style( 'fontawesome', get_stylesheet_directory_uri() . '/font-awesome/css/all.css' ); wp_enqueue_style( 'mvp-iecss', get_stylesheet_directory_uri() . '/css/iecss.css', array( 'mvp-style' ) ); wp_enqueue_style( 'mvp-fonts', mvp_fonts_url(), array(), null ); $wp_styles->add_data( 'mvp-iecss', 'conditional', 'lt IE 10' ); $mvp_rtl = get_option('mvp_rtl'); if ($mvp_rtl == "true") { if (isset($mvp_rtl)) { wp_enqueue_style( 'mvp-rtl', get_template_directory_uri() . '/css/rtl.css' ); } } $mvp_respond = get_option('mvp_respond'); if ($mvp_respond == "true") { if (isset($mvp_respond)) { $mvp_rtl = get_option('mvp_rtl'); if ($mvp_rtl == "true") { if (isset($mvp_rtl)) { wp_enqueue_style( 'mvp-media-queries', get_template_directory_uri() . '/css/media-queries-rtl.css' ); } } else { wp_enqueue_style( 'mvp-media-queries', get_template_directory_uri() . '/css/media-queries.css' ); } } } wp_register_script('mvp-custom', get_template_directory_uri() . '/js/mvpcustom.js', array('jquery'), '', true); wp_register_script('zoxnews', get_template_directory_uri() . '/js/scripts.js', array('jquery'), '', true); wp_register_script('retina', get_template_directory_uri() . '/js/retina.js', array('jquery'), '', true); wp_register_script('flexslider', get_template_directory_uri() . '/js/flexslider.js', array('jquery'), '', true); wp_register_script('infinitescroll', get_template_directory_uri() . '/js/jquery.infinitescroll.min.js', array('jquery'), '', true); wp_register_script('alp', get_template_directory_uri() . '/js/alp.js', array('jquery'), '', true); wp_enqueue_script('jquery'); wp_enqueue_script('mvp-custom'); wp_enqueue_script('zoxnews'); wp_enqueue_script('retina'); if ( is_single() ) wp_enqueue_script( 'flexslider' ); $mvp_infinite_scroll = get_option('mvp_infinite_scroll'); if ($mvp_infinite_scroll == "true") { if (isset($mvp_infinite_scroll)) { wp_enqueue_script('infinitescroll'); } } $mvp_alp = get_option('mvp_alp'); if ($mvp_alp == "true") { if (isset($mvp_alp)) { if ( is_single() ) wp_enqueue_script( 'alp' ); } } if ( is_singular() ) wp_enqueue_script( 'comment-reply' ); $mvp_nav_layout = get_option('mvp_nav_layout'); if( $mvp_nav_layout == "1" ) { $alp_side = get_option('mvp_alp'); if ( is_single() && $alp_side !== "true" ) { wp_add_inline_script( 'mvp-custom', ' jQuery(document).ready(function($) { var leaderHeight = $("#mvp-leader-wrap").outerHeight(); var navHeight = $("#mvp-main-head-wrap").outerHeight(); var headerHeight = navHeight + leaderHeight; var previousScroll = 0; $(window).scroll(function(event){ var scroll = $(this).scrollTop(); if ( typeof leaderHeight !== "undefined" ) { if ($(window).scrollTop() > headerHeight){ $("#mvp-main-nav-small").addClass("mvp-nav-small-fixed"); $("#mvp-main-body-wrap").css("margin-top", navHeight ); } else { $("#mvp-main-nav-small").removeClass("mvp-nav-small-fixed"); $("#mvp-main-body-wrap").css("margin-top","0"); } if ($(window).scrollTop() > headerHeight + 50){ $("#mvp-main-nav-small").addClass("mvp-fixed"); $("#mvp-main-nav-small").addClass("mvp-fixed-shadow"); $(".mvp-fly-top").addClass("mvp-to-top"); if(scroll < previousScroll) { $("#mvp-main-nav-small").removeClass("mvp-soc-mob-up"); $("#mvp-soc-mob-wrap").removeClass("mvp-soc-mob-up"); $(".mvp-drop-nav-title").removeClass("mvp-nav-small-post"); $(".mvp-nav-menu").show(); } else { $("#mvp-main-nav-small").addClass("mvp-soc-mob-up"); $("#mvp-soc-mob-wrap").addClass("mvp-soc-mob-up"); $(".mvp-drop-nav-title").addClass("mvp-nav-small-post"); $(".mvp-nav-menu").hide(); } } else { $("#mvp-main-nav-small").removeClass("mvp-fixed"); $("#mvp-main-nav-small").removeClass("mvp-fixed-shadow"); $(".mvp-fly-top").removeClass("mvp-to-top"); } } else { if ($(window).scrollTop() > navHeight){ $("#mvp-main-nav-small").addClass("mvp-nav-small-fixed"); $("#mvp-main-body-wrap").css("margin-top", navHeight ); } else { $("#mvp-main-nav-small").removeClass("mvp-nav-small-fixed"); $("#mvp-main-body-wrap").css("margin-top","0"); } if ($(window).scrollTop() > navHeight + 50){ $("#mvp-main-nav-small").addClass("mvp-fixed"); $("#mvp-main-nav-small").addClass("mvp-fixed-shadow"); $(".mvp-fly-top").addClass("mvp-to-top"); if(scroll < previousScroll) { $("#mvp-main-nav-small").removeClass("mvp-soc-mob-up"); $("#mvp-soc-mob-wrap").removeClass("mvp-soc-mob-up"); $(".mvp-drop-nav-title").removeClass("mvp-nav-small-post"); $(".mvp-nav-menu").show(); } else { $("#mvp-main-nav-small").addClass("mvp-soc-mob-up"); $("#mvp-soc-mob-wrap").addClass("mvp-soc-mob-up"); $(".mvp-drop-nav-title").addClass("mvp-nav-small-post"); $(".mvp-nav-menu").hide(); } } else { $("#mvp-main-nav-small").removeClass("mvp-fixed"); $("#mvp-main-nav-small").removeClass("mvp-fixed-shadow"); $(".mvp-fly-top").removeClass("mvp-to-top"); } } previousScroll = scroll; }); }); ' ); } else { wp_add_inline_script( 'mvp-custom', ' jQuery(document).ready(function($) { var leaderHeight = $("#mvp-leader-wrap").outerHeight(); var navHeight = $("#mvp-main-head-wrap").outerHeight(); var headerHeight = navHeight + leaderHeight; var previousScroll = 0; $(window).scroll(function(event){ var scroll = $(this).scrollTop(); if ( typeof leaderHeight !== "undefined" ) { if ($(window).scrollTop() > headerHeight){ $("#mvp-main-nav-small").addClass("mvp-nav-small-fixed"); $("#mvp-main-body-wrap").css("margin-top", navHeight ); } else { $("#mvp-main-nav-small").removeClass("mvp-nav-small-fixed"); $("#mvp-main-body-wrap").css("margin-top","0"); } if ($(window).scrollTop() > headerHeight + 50){ $("#mvp-main-nav-small").addClass("mvp-fixed"); $("#mvp-main-nav-small").addClass("mvp-fixed-shadow"); $(".mvp-fly-top").addClass("mvp-to-top"); } else { $("#mvp-main-nav-small").removeClass("mvp-fixed"); $("#mvp-main-nav-small").removeClass("mvp-fixed-shadow"); $(".mvp-fly-top").removeClass("mvp-to-top"); } } else { if ($(window).scrollTop() > navHeight){ $("#mvp-main-nav-small").addClass("mvp-nav-small-fixed"); $("#mvp-main-body-wrap").css("margin-top", navHeight ); } else { $("#mvp-main-nav-small").removeClass("mvp-nav-small-fixed"); $("#mvp-main-body-wrap").css("margin-top","0"); } if ($(window).scrollTop() > navHeight + 50){ $("#mvp-main-nav-small").addClass("mvp-fixed"); $("#mvp-main-nav-small").addClass("mvp-fixed-shadow"); $(".mvp-fly-top").addClass("mvp-to-top"); } else { $("#mvp-main-nav-small").removeClass("mvp-fixed"); $("#mvp-main-nav-small").removeClass("mvp-fixed-shadow"); $(".mvp-fly-top").removeClass("mvp-to-top"); } } previousScroll = scroll; }); }); ' ); } } else { $alp_side = get_option('mvp_alp'); if ( is_single() && $alp_side !== "true" ) { wp_add_inline_script( 'mvp-custom', ' jQuery(document).ready(function($) { var leaderHeight = $("#mvp-leader-wrap").outerHeight(); var logoHeight = $("#mvp-main-nav-top").outerHeight(); var botHeight = $("#mvp-main-nav-bot").outerHeight(); var navHeight = $("#mvp-main-head-wrap").outerHeight(); var headerHeight = navHeight + leaderHeight; var aboveNav = leaderHeight + logoHeight; var totalHeight = logoHeight + botHeight; var previousScroll = 0; $(window).scroll(function(event){ var scroll = $(this).scrollTop(); if ( typeof leaderHeight !== "undefined" ) { if ($(window).scrollTop() > aboveNav){ $("#mvp-main-nav-top").addClass("mvp-nav-small"); $("#mvp-main-nav-bot").css("margin-top", logoHeight ); } else { $("#mvp-main-nav-top").removeClass("mvp-nav-small"); $("#mvp-main-nav-bot").css("margin-top","0"); } if ($(window).scrollTop() > headerHeight){ $("#mvp-main-nav-top").addClass("mvp-fixed"); $("#mvp-main-nav-bot").addClass("mvp-fixed1"); $("#mvp-main-body-wrap").css("margin-top", totalHeight ); $("#mvp-main-nav-top").addClass("mvp-fixed-shadow"); $(".mvp-nav-top-mid").addClass("mvp-fixed-post"); $(".mvp-drop-nav-title").show(); $(".mvp-fly-top").addClass("mvp-to-top"); if(scroll < previousScroll) { $("#mvp-main-nav-bot").addClass("mvp-fixed2"); $("#mvp-main-nav-top").removeClass("mvp-fixed-shadow"); $("#mvp-main-nav-top").removeClass("mvp-soc-mob-up"); $("#mvp-soc-mob-wrap").removeClass("mvp-soc-mob-up"); } else { $("#mvp-main-nav-bot").removeClass("mvp-fixed2"); $("#mvp-main-nav-top").addClass("mvp-fixed-shadow"); $("#mvp-main-nav-top").addClass("mvp-soc-mob-up"); $("#mvp-soc-mob-wrap").addClass("mvp-soc-mob-up"); } } else { $("#mvp-main-nav-top").removeClass("mvp-fixed"); $("#mvp-main-nav-bot").removeClass("mvp-fixed1"); $("#mvp-main-nav-bot").removeClass("mvp-fixed2"); $("#mvp-main-body-wrap").css("margin-top","0"); $("#mvp-main-nav-top").removeClass("mvp-fixed-shadow"); $(".mvp-nav-top-mid").removeClass("mvp-fixed-post"); $(".mvp-drop-nav-title").hide(); $(".mvp-fly-top").removeClass("mvp-to-top"); } } else { if ($(window).scrollTop() > logoHeight){ $("#mvp-main-nav-top").addClass("mvp-nav-small"); $("#mvp-main-nav-bot").css("margin-top", logoHeight ); } else { $("#mvp-main-nav-top").removeClass("mvp-nav-small"); $("#mvp-main-nav-bot").css("margin-top","0"); } if ($(window).scrollTop() > navHeight){ $("#mvp-main-nav-top").addClass("mvp-fixed"); $("#mvp-main-nav-bot").addClass("mvp-fixed1"); $("#mvp-main-body-wrap").css("margin-top", totalHeight ); $("#mvp-main-nav-top").addClass("mvp-fixed-shadow"); $(".mvp-nav-top-mid").addClass("mvp-fixed-post"); $(".mvp-drop-nav-title").show(); $(".mvp-fly-top").addClass("mvp-to-top"); if(scroll < previousScroll) { $("#mvp-main-nav-bot").addClass("mvp-fixed2"); $("#mvp-main-nav-top").removeClass("mvp-fixed-shadow"); $("#mvp-main-nav-top").removeClass("mvp-soc-mob-up"); $("#mvp-soc-mob-wrap").removeClass("mvp-soc-mob-up"); } else { $("#mvp-main-nav-bot").removeClass("mvp-fixed2"); $("#mvp-main-nav-top").addClass("mvp-fixed-shadow"); $("#mvp-main-nav-top").addClass("mvp-soc-mob-up"); $("#mvp-soc-mob-wrap").addClass("mvp-soc-mob-up"); } } else { $("#mvp-main-nav-top").removeClass("mvp-fixed"); $("#mvp-main-nav-bot").removeClass("mvp-fixed1"); $("#mvp-main-nav-bot").removeClass("mvp-fixed2"); $("#mvp-main-body-wrap").css("margin-top","0"); $("#mvp-main-nav-top").removeClass("mvp-fixed-shadow"); $(".mvp-nav-top-mid").removeClass("mvp-fixed-post"); $(".mvp-drop-nav-title").hide(); $(".mvp-fly-top").removeClass("mvp-to-top"); } } previousScroll = scroll; }); }); ' ); } else { wp_add_inline_script( 'mvp-custom', ' jQuery(document).ready(function($) { var leaderHeight = $("#mvp-leader-wrap").outerHeight(); var logoHeight = $("#mvp-main-nav-top").outerHeight(); var botHeight = $("#mvp-main-nav-bot").outerHeight(); var navHeight = $("#mvp-main-head-wrap").outerHeight(); var headerHeight = navHeight + leaderHeight; var aboveNav = leaderHeight + logoHeight; var totalHeight = logoHeight + botHeight; var previousScroll = 0; $(window).scroll(function(event){ var scroll = $(this).scrollTop(); if ( typeof leaderHeight !== "undefined" ) { if ($(window).scrollTop() > aboveNav){ $("#mvp-main-nav-top").addClass("mvp-nav-small"); $("#mvp-main-nav-bot").css("margin-top", logoHeight ); } else { $("#mvp-main-nav-top").removeClass("mvp-nav-small"); $("#mvp-main-nav-bot").css("margin-top","0"); } if ($(window).scrollTop() > headerHeight){ $("#mvp-main-nav-top").addClass("mvp-fixed"); $("#mvp-main-nav-bot").addClass("mvp-fixed1"); $("#mvp-main-body-wrap").css("margin-top", totalHeight ); $("#mvp-main-nav-top").addClass("mvp-fixed-shadow"); $(".mvp-fly-top").addClass("mvp-to-top"); if(scroll < previousScroll) { $("#mvp-main-nav-bot").addClass("mvp-fixed2"); $("#mvp-main-nav-top").removeClass("mvp-fixed-shadow"); } else { $("#mvp-main-nav-bot").removeClass("mvp-fixed2"); $("#mvp-main-nav-top").addClass("mvp-fixed-shadow"); } } else { $("#mvp-main-nav-top").removeClass("mvp-fixed"); $("#mvp-main-nav-bot").removeClass("mvp-fixed1"); $("#mvp-main-nav-bot").removeClass("mvp-fixed2"); $("#mvp-main-body-wrap").css("margin-top","0"); $("#mvp-main-nav-top").removeClass("mvp-fixed-shadow"); $(".mvp-fly-top").removeClass("mvp-to-top"); } } else { if ($(window).scrollTop() > logoHeight){ $("#mvp-main-nav-top").addClass("mvp-nav-small"); $("#mvp-main-nav-bot").css("margin-top", logoHeight ); } else { $("#mvp-main-nav-top").removeClass("mvp-nav-small"); $("#mvp-main-nav-bot").css("margin-top","0"); } if ($(window).scrollTop() > navHeight){ $("#mvp-main-nav-top").addClass("mvp-fixed"); $("#mvp-main-nav-bot").addClass("mvp-fixed1"); $("#mvp-main-body-wrap").css("margin-top", totalHeight ); $("#mvp-main-nav-top").addClass("mvp-fixed-shadow"); $(".mvp-fly-top").addClass("mvp-to-top"); if(scroll < previousScroll) { $("#mvp-main-nav-bot").addClass("mvp-fixed2"); $("#mvp-main-nav-top").removeClass("mvp-fixed-shadow"); } else { $("#mvp-main-nav-bot").removeClass("mvp-fixed2"); $("#mvp-main-nav-top").addClass("mvp-fixed-shadow"); } } else { $("#mvp-main-nav-top").removeClass("mvp-fixed"); $("#mvp-main-nav-bot").removeClass("mvp-fixed1"); $("#mvp-main-nav-bot").removeClass("mvp-fixed2"); $("#mvp-main-body-wrap").css("margin-top","0"); $("#mvp-main-nav-top").removeClass("mvp-fixed-shadow"); $(".mvp-fly-top").removeClass("mvp-to-top"); } } previousScroll = scroll; }); $(".mvp-alp-side-in").niceScroll({cursorcolor:"#ccc",cursorwidth: 5,cursorborder: 0,zindex:999999}); }); ' ); } } $mvp_alp = get_option('mvp_alp'); if ($mvp_alp !== "true") { $mvp_scroll_vid = get_option('mvp_scroll_vid'); if ($mvp_scroll_vid == "true") { if (isset($mvp_scroll_vid)) { if ( is_single() ) { wp_add_inline_script( 'mvp-custom', ' jQuery(document).ready(function($) { // Video Post Scroll $(window).on("scroll.video", function(event){ var scrollTop = $(window).scrollTop(); var elementOffset = $("#mvp-content-wrap").offset().top; var distance = (elementOffset - scrollTop); var aboveHeight = $("#mvp-video-embed-wrap").outerHeight(); if ($(window).scrollTop() > distance + aboveHeight + screen.height){ $("#mvp-video-embed-cont").addClass("mvp-vid-fixed"); $("#mvp-video-embed-wrap").addClass("mvp-vid-height"); $(".mvp-video-close").show(); } else { $("#mvp-video-embed-cont").removeClass("mvp-vid-fixed"); $("#mvp-video-embed-wrap").removeClass("mvp-vid-height"); $(".mvp-video-close").hide(); } }); $(".mvp-video-close").on("click", function(){ $("#mvp-video-embed-cont").removeClass("mvp-vid-fixed"); $("#mvp-video-embed-wrap").removeClass("mvp-vid-height"); $(".mvp-video-close").hide(); $(window).off("scroll.video"); }); }); ' ); } } } } global $post; $socialbox = get_option('mvp_social_box'); if ($socialbox == "true") { if (isset($socialbox)) { wp_add_inline_script( 'mvp-custom', ' jQuery(document).ready(function($) { // Mobile Social Buttons More $(".mvp-soc-mob-right").on("click", function(){ $("#mvp-soc-mob-wrap").toggleClass("mvp-soc-mob-more"); }); }); ' ); } } $mvp_cont_read = get_option('mvp_cont_read'); if ($mvp_cont_read == "true") { if (isset($mvp_cont_read)) { wp_add_inline_script( 'mvp-custom', ' jQuery(document).ready(function($) { // Continue Reading Button $(".mvp-cont-read-but").on("click", function(){ $("#mvp-content-body-top").css("max-height","none"); $("#mvp-content-body-top").css("overflow","visible"); $(".mvp-cont-read-but-wrap").hide(); }); }); ' ); } } // Parallax Leaderboard $mvp_para_lead = get_option('mvp_para_lead'); if ($mvp_para_lead == "true") { if (isset($mvp_para_lead)) { if(get_option('mvp_header_leader')) { wp_add_inline_script( 'mvp-custom', ' jQuery(document).ready(function($) { var leaderHeight = $("#mvp-leader-wrap").outerHeight(); $("#mvp-site-main").css("margin-top", leaderHeight ); $(window).resize(function(){ var leaderHeight = $("#mvp-leader-wrap").outerHeight(); $("#mvp-site-main").css("margin-top", leaderHeight ); }); }); ' ); } } } // Main Menu Dropdown Toggle wp_add_inline_script( 'mvp-custom', ' jQuery(document).ready(function($) { $(".menu-item-has-children a").click(function(event){ event.stopPropagation(); }); $(".menu-item-has-children").click(function(){ $(this).addClass("toggled"); if($(".menu-item-has-children").hasClass("toggled")) { $(this).children("ul").toggle(); $(".mvp-fly-nav-menu").getNiceScroll().resize(); } $(this).toggleClass("tog-minus"); return false; }); // Main Menu Scroll $(".mvp-fly-nav-menu").niceScroll({cursorcolor:"#888",cursorwidth: 7,cursorborder: 0,zindex:999999}); }); ' ); $mvp_infinite_scroll = get_option('mvp_infinite_scroll'); if ($mvp_infinite_scroll == "true") { if (isset($mvp_infinite_scroll)) { wp_add_inline_script( 'mvp-custom', ' jQuery(document).ready(function($) { $(".infinite-content").infinitescroll({ navSelector: ".mvp-nav-links", nextSelector: ".mvp-nav-links a:first", itemSelector: ".infinite-post", errorCallback: function(){ $(".mvp-inf-more-but").css("display", "none") } }); $(window).unbind(".infscr"); $(".mvp-inf-more-but").click(function(){ $(".infinite-content").infinitescroll("retrieve"); return false; }); if ($(".mvp-nav-links a").length) { $(".mvp-inf-more-but").css("display","inline-block"); } else { $(".mvp-inf-more-but").css("display","none"); } }); ' ); } } if ( is_single() ) { global $post; $mvp_show_gallery = get_post_meta($post->ID, "mvp_post_gallery", true); if ($mvp_show_gallery == "show") { wp_add_inline_script( 'mvp-custom', ' jQuery(document).ready(function($) { $(".mvp-post-gallery-bot").flexslider({ animation: "slide", controlNav: false, animationLoop: true, slideshow: false, itemWidth: 80, itemMargin: 0, asNavFor: ".mvp-post-gallery-top" }); $(".mvp-post-gallery-top").flexslider({ animation: "fade", controlNav: false, animationLoop: true, slideshow: false, prevText: "<", nextText: ">", sync: ".mvp-post-gallery-bot" }); }); ' ); } } } } add_action('wp_enqueue_scripts', 'mvp_scripts_method'); ///////////////////////////////////// // Register Widgets ///////////////////////////////////// if ( !function_exists( 'mvp_sidebars_init' ) ) { function mvp_sidebars_init() { register_sidebar(array( 'id' => 'homepage-widget', 'name' => esc_html__( 'Homepage Widget Area', 'zox-news' ), 'description' => esc_html__( 'The widgetized area in the main content area of the homepage.', 'zox-news' ), 'before_widget' => '
', 'after_widget' => '
', 'before_title' => '

', 'after_title' => '

', )); register_sidebar(array( 'id' => 'mvp-home-sidebar-widget', 'name' => esc_html__( 'Homepage Sidebar Widget Area', 'zox-news' ), 'description' => esc_html__( 'The widgetized sidebar on the homepage.', 'zox-news' ), 'before_widget' => '
', 'after_widget' => '
', 'before_title' => '

', 'after_title' => '

', )); register_sidebar(array( 'id' => 'mvp-sidebar-widget', 'name' => esc_html__( 'Default Sidebar Widget Area', 'zox-news' ), 'description' => esc_html__( 'The default widgetized sidebar.', 'zox-news' ), 'before_widget' => '
', 'after_widget' => '
', 'before_title' => '

', 'after_title' => '

', )); register_sidebar(array( 'id' => 'mvp-sidebar-widget-post', 'name' => esc_html__( 'Post/Page Sidebar Widget Area', 'zox-news' ), 'description' => esc_html__( 'The widgetized sidebar on posts and pages.', 'zox-news' ), 'before_widget' => '
', 'after_widget' => '
', 'before_title' => '

', 'after_title' => '

', )); register_sidebar(array( 'id' => 'mvp-sidebar-woo-widget', 'name' => esc_html__( 'WooCommerce Sidebar Widget Area', 'zox-news' ), 'description' => esc_html__( 'The widgetized sidebar on your WooCommerce pages.', 'zox-news' ), 'before_widget' => '
', 'after_widget' => '
', 'before_title' => '

', 'after_title' => '

', )); register_sidebar(array( 'id' => 'eyayin-widget', 'name' => esc_html__( 'E-Yayın', 'zox-news' ), 'description' => esc_html__( 'Yayınlar sayfası bileşeni.', 'zox-news' ), 'before_widget' => '
', 'after_widget' => '
', 'before_title' => '

', 'after_title' => '

', )); } } add_action( 'widgets_init', 'mvp_sidebars_init' ); include( get_template_directory() . '/widgets/widget-ad.php'); include( get_template_directory() . '/widgets/widget-facebook.php'); include( get_template_directory() . '/widgets/widget-flex.php'); include( get_template_directory() . '/widgets/widget-home-dark.php'); include( get_template_directory() . '/widgets/widget-home-feat1.php'); include( get_template_directory() . '/widgets/widget-home-feat2.php'); include( get_template_directory() . '/widgets/widget-tabber.php'); include( get_template_directory() . '/widgets/widget-yazarlar.php'); include( get_template_directory() . '/widgets/widget-yayinlar.php'); ///////////////////////////////////// // Register Custom Menus ///////////////////////////////////// if ( !function_exists( 'register_menus' ) ) { function register_menus() { register_nav_menus( array( 'main-menu' => esc_html__( 'Main Menu', 'zox-news' ), 'mobile-menu' => esc_html__( 'Fly-Out Menu', 'zox-news' ), 'amp-menu' => esc_html__( 'Fly-Out AMP Menu', 'zox-news' ), 'footer-menu' => esc_html__( 'Footer Menu', 'zox-news' )) ); } } add_action( 'init', 'register_menus' ); ///////////////////////////////////// // Register Mega Menu ///////////////////////////////////// $mvp_megamenu = get_option('mvp_megamenu'); if ($mvp_megamenu == "true") { if (isset($mvp_megamenu)) { add_filter( 'walker_nav_menu_start_el', 'mvp_walker_nav_menu_start_el', 10, 4 ); function mvp_walker_nav_menu_start_el( $item_output, $item, $depth, $args ) { global $wp_query; // The mega dropdown only applies to the main navigation. // Your theme location name may be different, "main" is just something I tend to use. if ( 'main-menu' !== $args->theme_location ) return $item_output; // The mega dropdown needs to be added to one specific menu item. // I like to add a custom CSS class for that menu via the admin area. // You could also do an item ID check. if ( in_array( 'menu-item-object-category', $item->classes ) ) { global $wp_query; global $post; $subposts = get_posts( 'numberposts=5&cat=' . $item->object_id ); $item_output .= '
'; } return $item_output; } function mvp_mega_class($classes, $item, $args) { if($args->theme_location == 'main-menu') { if( $item->type == 'taxonomy' ) { $classes[] = 'mvp-mega-dropdown'; } } return $classes; } add_filter('nav_menu_css_class', 'mvp_mega_class', 1, 3); } } ///////////////////////////////////// // Register Custom Background ///////////////////////////////////// $custombg = array( 'default-color' => 'ffffff', ); add_theme_support( 'custom-background', $custombg ); ///////////////////////////////////// // Register Thumbnails ///////////////////////////////////// if ( function_exists( 'add_theme_support' ) ) { add_theme_support( 'post-thumbnails' ); set_post_thumbnail_size( 1000, 600, true ); add_image_size( 'mvp-post-thumb', 1000, 600, true ); add_image_size( 'mvp-yenimanset-thumb', 860, 600, true ); add_image_size( 'mvp-port-thumb', 560, 600, true ); add_image_size( 'mvp-large-thumb', 590, 354, true ); add_image_size( 'mvp-mid-thumb', 400, 240, true ); add_image_size( 'mvp-habermatik-gazete', 260, 360, true ); add_image_size( 'mvp-small-thumb', 80, 80, true ); } ///////////////////////////////////// // Title Meta Data ///////////////////////////////////// add_theme_support( 'title-tag' ); function mvp_filter_home_title(){ if ( ( is_home() && ! is_front_page() ) || ( ! is_home() && is_front_page() ) ) { $mvpHomeTitle = get_bloginfo( 'name', 'display' ); $mvpHomeDesc = get_bloginfo( 'description', 'display' ); return $mvpHomeTitle . " - " . $mvpHomeDesc; } } add_filter( 'pre_get_document_title', 'mvp_filter_home_title'); ///////////////////////////////////// // Add Custom Meta Box ///////////////////////////////////// /* Fire our meta box setup function on the post editor screen. */ add_action( 'load-post.php', 'mvp_post_meta_boxes_setup' ); add_action( 'load-post-new.php', 'mvp_post_meta_boxes_setup' ); /* Meta box setup function. */ if ( !function_exists( 'mvp_post_meta_boxes_setup' ) ) { function mvp_post_meta_boxes_setup() { /* Add meta boxes on the 'add_meta_boxes' hook. */ add_action( 'add_meta_boxes', 'mvp_add_post_meta_boxes' ); /* Save post meta on the 'save_post' hook. */ add_action( 'save_post', 'mvp_save_video_embed_meta', 10, 2 ); add_action( 'save_post', 'mvp_save_featured_headline_meta', 10, 2 ); add_action( 'save_post', 'mvp_save_photo_credit_meta', 10, 2 ); add_action( 'save_post', 'mvp_save_habermatik_eyayin_meta', 10, 2 ); add_action( 'save_post', 'mvp_save_post_template_meta', 10, 2 ); add_action( 'save_post', 'mvp_save_featured_image_meta', 10, 2 ); add_action( 'save_post', 'mvp_save_post_gallery_meta', 10, 2 ); } } /* Create one or more meta boxes to be displayed on the post editor screen. */ if ( !function_exists( 'mvp_add_post_meta_boxes' ) ) { function mvp_add_post_meta_boxes() { add_meta_box( 'mvp-video-embed', // Unique ID esc_html__( 'Video/Audio Embed', 'zox-news' ), // Title 'mvp_video_embed_meta_box', // Callback function 'post', // Admin page (or post type) 'normal', // Context 'high' // Priority ); add_meta_box( 'mvp-featured-headline', // Unique ID esc_html__( 'Manşet Başlığı', 'zox-news' ), // Title 'mvp_featured_headline_meta_box', // Callback function 'post', // Admin page (or post type) 'normal', // Context 'high' // Priority ); add_meta_box( 'mvp-photo-credit', // Unique ID esc_html__( 'Öne Çıkan Resim Altyazısı', 'zox-news' ), // Title 'mvp_photo_credit_meta_box', // Callback function 'post', // Admin page (or post type) 'normal', // Context 'high' // Priority ); add_meta_box( 'habermatik-eyayin', // Unique ID esc_html__( 'E-Yayın', 'zox-news' ), // Title 'habermatik_eyayin_meta_box', // Callback function 'post', // Admin page (or post type) 'normal', // Context 'high' // Priority ); add_meta_box( 'mvp-post-template', // Unique ID esc_html__( 'Yazı Şablonu', 'zox-news' ), // Title 'mvp_post_template_meta_box', // Callback function 'post', // Admin page (or post type) 'side', // Context 'core' // Priority ); add_meta_box( 'mvp-featured-image', // Unique ID esc_html__( 'Öne Çıkan Görsel', 'zox-news' ), // Title 'mvp_featured_image_meta_box', // Callback function 'post', // Admin page (or post type) 'side', // Context 'core' // Priority ); add_meta_box( 'mvp-post-gallery', // Unique ID esc_html__( 'Yazı İçi Galeri', 'zox-news' ), // Title 'mvp_post_gallery_meta_box', // Callback function 'post', // Admin page (or post type) 'side', // Context 'core' // Priority ); } } /* Display the post meta box. */ if ( !function_exists( 'mvp_featured_headline_meta_box' ) ) { function mvp_featured_headline_meta_box( $object, $box ) { ?>




ID, 'habermatik_eyayin', true );?>

ID, 'mvp_post_template', true ) ); ?>



ID, 'mvp_featured_image', true ) ); ?>



ID, 'mvp_post_gallery', true ) ); ?>



post_type ); /* Check if the current user has permission to edit the post. */ if ( !current_user_can( $post_type->cap->edit_post, $post_id ) ) return $post_id; /* Get the posted data and sanitize it for use as an HTML class. */ $new_meta_value = ( isset( $_POST['mvp-video-embed'] ) ? balanceTags( $_POST['mvp-video-embed'] ) : '' ); /* Get the meta key. */ $meta_key = 'mvp_video_embed'; /* Get the meta value of the custom field key. */ $meta_value = get_post_meta( $post_id, $meta_key, true ); /* If a new meta value was added and there was no previous value, add it. */ if ( $new_meta_value && '' == $meta_value ) add_post_meta( $post_id, $meta_key, $new_meta_value, true ); /* If the new meta value does not match the old value, update it. */ elseif ( $new_meta_value && $new_meta_value != $meta_value ) update_post_meta( $post_id, $meta_key, $new_meta_value ); /* If there is no new meta value but an old value exists, delete it. */ elseif ( '' == $new_meta_value && $meta_value ) delete_post_meta( $post_id, $meta_key, $meta_value ); } } /* Save the meta box's post metadata. */ if ( !function_exists( 'mvp_save_featured_headline_meta' ) ) { function mvp_save_featured_headline_meta( $post_id, $post ) { /* Verify the nonce before proceeding. */ if ( !isset( $_POST['mvp_featured_headline_nonce'] ) || !wp_verify_nonce( $_POST['mvp_featured_headline_nonce'], 'mvp_save_featured_headline_meta' ) ) return $post_id; /* Get the post type object. */ $post_type = get_post_type_object( $post->post_type ); /* Check if the current user has permission to edit the post. */ if ( !current_user_can( $post_type->cap->edit_post, $post_id ) ) return $post_id; /* Get the posted data and sanitize it for use as an HTML class. */ $new_meta_value = ( isset( $_POST['mvp-featured-headline'] ) ? balanceTags( $_POST['mvp-featured-headline'] ) : '' ); /* Get the meta key. */ $meta_key = 'mvp_featured_headline'; /* Get the meta value of the custom field key. */ $meta_value = get_post_meta( $post_id, $meta_key, true ); /* If a new meta value was added and there was no previous value, add it. */ if ( $new_meta_value && '' == $meta_value ) add_post_meta( $post_id, $meta_key, $new_meta_value, true ); /* If the new meta value does not match the old value, update it. */ elseif ( $new_meta_value && $new_meta_value != $meta_value ) update_post_meta( $post_id, $meta_key, $new_meta_value ); /* If there is no new meta value but an old value exists, delete it. */ elseif ( '' == $new_meta_value && $meta_value ) delete_post_meta( $post_id, $meta_key, $meta_value ); } } /* Save the meta box's post metadata. */ if ( !function_exists( 'mvp_save_photo_credit_meta' ) ) { function mvp_save_photo_credit_meta( $post_id, $post ) { /* Verify the nonce before proceeding. */ if ( !isset( $_POST['mvp_photo_credit_nonce'] ) || !wp_verify_nonce( $_POST['mvp_photo_credit_nonce'], 'mvp_save_photo_credit_meta' ) ) return $post_id; /* Get the post type object. */ $post_type = get_post_type_object( $post->post_type ); /* Check if the current user has permission to edit the post. */ if ( !current_user_can( $post_type->cap->edit_post, $post_id ) ) return $post_id; /* Get the posted data and sanitize it for use as an HTML class. */ $new_meta_value = ( isset( $_POST['mvp-photo-credit'] ) ? balanceTags( $_POST['mvp-photo-credit'] ) : '' ); /* Get the meta key. */ $meta_key = 'mvp_photo_credit'; /* Get the meta value of the custom field key. */ $meta_value = get_post_meta( $post_id, $meta_key, true ); /* If a new meta value was added and there was no previous value, add it. */ if ( $new_meta_value && '' == $meta_value ) add_post_meta( $post_id, $meta_key, $new_meta_value, true ); /* If the new meta value does not match the old value, update it. */ elseif ( $new_meta_value && $new_meta_value != $meta_value ) update_post_meta( $post_id, $meta_key, $new_meta_value ); /* If there is no new meta value but an old value exists, delete it. */ elseif ( '' == $new_meta_value && $meta_value ) delete_post_meta( $post_id, $meta_key, $meta_value ); } } /* E- Yayın Save the meta box's post metadata. */ if ( !function_exists( 'mvp_save_habermatik_eyayin_meta' ) ) { function mvp_save_habermatik_eyayin_meta( $post_id, $post ) { /* Verify the nonce before proceeding. */ if ( !isset( $_POST['mvp_habermatik_eyayin_nonce'] ) || !wp_verify_nonce( $_POST['mvp_habermatik_eyayin_nonce'], 'mvp_save_habermatik_eyayin_meta' ) ) return $post_id; /* Get the post type object. */ $post_type = get_post_type_object( $post->post_type ); /* Check if the current user has permission to edit the post. */ if ( !current_user_can( $post_type->cap->edit_post, $post_id ) ) return $post_id; /* Get the posted data and sanitize it for use as an HTML class. */ $new_meta_value = ( isset( $_POST['habermatik-eyayin'] ) ? balanceTags( $_POST['habermatik-eyayin'] ) : '' ); /* Get the meta key. */ $meta_key = 'habermatik_eyayin'; /* Get the meta value of the custom field key. */ $meta_value = get_post_meta( $post_id, $meta_key, true ); /* If a new meta value was added and there was no previous value, add it. */ if ( $new_meta_value && '' == $meta_value ) add_post_meta( $post_id, $meta_key, $new_meta_value, true ); /* If the new meta value does not match the old value, update it. */ elseif ( $new_meta_value && $new_meta_value != $meta_value ) update_post_meta( $post_id, $meta_key, $new_meta_value ); /* If there is no new meta value but an old value exists, delete it. */ elseif ( '' == $new_meta_value && $meta_value ) delete_post_meta( $post_id, $meta_key, $meta_value ); } } /* Save the meta box's post metadata. */ if ( !function_exists( 'mvp_save_post_template_meta' ) ) { function mvp_save_post_template_meta( $post_id, $post ) { /* Verify the nonce before proceeding. */ if ( !isset( $_POST['mvp_post_template_nonce'] ) || !wp_verify_nonce( $_POST['mvp_post_template_nonce'], 'mvp_save_post_template_meta' ) ) return $post_id; /* Get the post type object. */ $post_type = get_post_type_object( $post->post_type ); /* Check if the current user has permission to edit the post. */ if ( !current_user_can( $post_type->cap->edit_post, $post_id ) ) return $post_id; /* Get the posted data and sanitize it for use as an HTML class. */ $new_meta_value = ( isset( $_POST['mvp-post-template'] ) ? balanceTags( $_POST['mvp-post-template'] ) : '' ); /* Get the meta key. */ $meta_key = 'mvp_post_template'; /* Get the meta value of the custom field key. */ $meta_value = get_post_meta( $post_id, $meta_key, true ); /* If a new meta value was added and there was no previous value, add it. */ if ( $new_meta_value && '' == $meta_value ) add_post_meta( $post_id, $meta_key, $new_meta_value, true ); /* If the new meta value does not match the old value, update it. */ elseif ( $new_meta_value && $new_meta_value != $meta_value ) update_post_meta( $post_id, $meta_key, $new_meta_value ); /* If there is no new meta value but an old value exists, delete it. */ elseif ( '' == $new_meta_value && $meta_value ) delete_post_meta( $post_id, $meta_key, $meta_value ); } } /* Save the meta box's post metadata. */ if ( !function_exists( 'mvp_save_featured_image_meta' ) ) { function mvp_save_featured_image_meta( $post_id, $post ) { /* Verify the nonce before proceeding. */ if ( !isset( $_POST['mvp_featured_image_nonce'] ) || !wp_verify_nonce( $_POST['mvp_featured_image_nonce'], 'mvp_save_featured_image_meta' ) ) return $post_id; /* Get the post type object. */ $post_type = get_post_type_object( $post->post_type ); /* Check if the current user has permission to edit the post. */ if ( !current_user_can( $post_type->cap->edit_post, $post_id ) ) return $post_id; /* Get the posted data and sanitize it for use as an HTML class. */ $new_meta_value = ( isset( $_POST['mvp-featured-image'] ) ? balanceTags( $_POST['mvp-featured-image'] ) : '' ); /* Get the meta key. */ $meta_key = 'mvp_featured_image'; /* Get the meta value of the custom field key. */ $meta_value = get_post_meta( $post_id, $meta_key, true ); /* If a new meta value was added and there was no previous value, add it. */ if ( $new_meta_value && '' == $meta_value ) add_post_meta( $post_id, $meta_key, $new_meta_value, true ); /* If the new meta value does not match the old value, update it. */ elseif ( $new_meta_value && $new_meta_value != $meta_value ) update_post_meta( $post_id, $meta_key, $new_meta_value ); /* If there is no new meta value but an old value exists, delete it. */ elseif ( '' == $new_meta_value && $meta_value ) delete_post_meta( $post_id, $meta_key, $meta_value ); } } /* Save the meta box's post metadata. */ if ( !function_exists( 'mvp_save_post_gallery_meta' ) ) { function mvp_save_post_gallery_meta( $post_id, $post ) { /* Verify the nonce before proceeding. */ if ( !isset( $_POST['mvp_post_gallery_nonce'] ) || !wp_verify_nonce( $_POST['mvp_post_gallery_nonce'], 'mvp_save_post_gallery_meta' ) ) return $post_id; /* Get the post type object. */ $post_type = get_post_type_object( $post->post_type ); /* Check if the current user has permission to edit the post. */ if ( !current_user_can( $post_type->cap->edit_post, $post_id ) ) return $post_id; /* Get the posted data and sanitize it for use as an HTML class. */ $new_meta_value = ( isset( $_POST['mvp-post-gallery'] ) ? balanceTags( $_POST['mvp-post-gallery'] ) : '' ); /* Get the meta key. */ $meta_key = 'mvp_post_gallery'; /* Get the meta value of the custom field key. */ $meta_value = get_post_meta( $post_id, $meta_key, true ); /* If a new meta value was added and there was no previous value, add it. */ if ( $new_meta_value && '' == $meta_value ) add_post_meta( $post_id, $meta_key, $new_meta_value, true ); /* If the new meta value does not match the old value, update it. */ elseif ( $new_meta_value && $new_meta_value != $meta_value ) update_post_meta( $post_id, $meta_key, $new_meta_value ); /* If there is no new meta value but an old value exists, delete it. */ elseif ( '' == $new_meta_value && $meta_value ) delete_post_meta( $post_id, $meta_key, $meta_value ); } } ///////////////////////////////////// // Comments ///////////////////////////////////// if ( !function_exists( 'mvp_comment' ) ) { function mvp_comment( $comment, $args, $depth ) { $GLOBALS['comment'] = $comment; switch ( $comment->comment_type ) : case '': case 'comment' : ?>
  • id="li-comment-">

    %s', get_comment_author_link() ) ); ?>

    comment_approved == '0' ) : ?>

    $depth, 'max_depth' => $args['max_depth'] ) ) ); ?>
  • jQuery(document).ready(function($) { $(".mvp-com-click-'.$post->ID.'").on("click", function(){ $(".mvp-com-click-id-'.$post->ID.'").show(); $(".mvp-disqus-thread-'.$post->ID.'").show(); $(".mvp-com-but-'.$post->ID.'").hide(); }); }); '; } } ///////////////////////////////////// // Related Posts ///////////////////////////////////// if ( !function_exists( 'mvp_RelatedPosts' ) ) { function mvp_RelatedPosts() { global $post; $orig_post = $post; $tags = wp_get_post_tags($post->ID); if ($tags) { $mvp_related_num = esc_html(get_option('mvp_related_num')); $slider_exclude = esc_html(get_option('mvp_feat_posts_tags')); $tag_exclude_slider = get_term_by('slug', $slider_exclude, 'post_tag'); if (!empty( $tag_exclude_slider )) { $tag_id_exclude_slider = $tag_exclude_slider->term_id; $tag_ids = array(); foreach($tags as $individual_tag) { $excluded_tags = array($tag_id_exclude_slider); if (in_array($individual_tag->term_id,$excluded_tags)) continue; $tag_ids[] = $individual_tag->term_id; } } else { $tag_ids = array(); foreach($tags as $individual_tag) $tag_ids[] = $individual_tag->term_id; } $args=array( 'tag__in' => $tag_ids, 'order' => 'DESC', 'orderby' => 'date', 'post__not_in' => array($post->ID), 'posts_per_page'=> $mvp_related_num, 'ignore_sticky_posts'=> 1 ); $my_query = new WP_Query( $args ); if( $my_query->have_posts() ) { ?>