bklink 0 ارسال شده در اردیبهشت 95 گزارش بازنشر ارسال شده در اردیبهشت 95 سلام یهو بدون هیچ دلیلی قست آپلود عکس وردپرس داخل پست ها از بین رفته و قسمتی برای آپلود عکس وجود نداره میدونم از بخش رسانه میشه عکس اضافه کرد اما چی کار کنم قسمت آپلود تصاویر شاخص به داخل پست ها اضافه بشه؟ قتی روی اضافه کردن تصویر شاخص می زنم توی پنجره جدید، قسمت بارگذاری تصویر از بین رفته! عکس رو پیوست کردم لطفاً کمک کنید نقل قول لینک به ارسال
imanfakhar 26231 ارسال شده در اردیبهشت 95 گزارش بازنشر ارسال شده در اردیبهشت 95 فایل functions.php قالبتون رو بگذارید اینجا 2 نقل قول لینک به ارسال
bklink 0 ارسال شده در اردیبهشت 95 مالک گزارش بازنشر ارسال شده در اردیبهشت 95 <?php add_theme_support( 'post-thumbnails' ); add_action( 'wp_enqueue_scripts', 'onlinewebsite_script_enqueuer' ); function onlinewebsite_script_enqueuer() { wp_enqueue_script( 'jquery' ); wp_register_script( "wp_onlinewebsite_js", get_bloginfo('template_directory').'/js/plugins.js', array('jquery') ); wp_enqueue_script('wp_onlinewebsite_js'); } require_once get_template_directory() . '/onlinewebsite/theme.php'; function twentyfifteen_widgets_init() { register_sidebar( array( 'name' => 'ابزارک کنار سایت', 'id' => 'sidebar-1', 'description' => 'ابزارک های مورد نظر را در این قسمت قرار دهید', 'before_widget' => '<section id="%1$s" class="widget aside collapse %2$s">', 'after_widget' => '</section>', 'before_title' => '<div class="title"><h3>', 'after_title' => '</h3></div>', ) ); } add_action( 'widgets_init', 'twentyfifteen_widgets_init' ); function onlinewebsite_theme_comment($comment, $args, $depth) { // print_r($comment); ?> <div <?php comment_class( ( $depth==1 ) ? 'commentset' : 'comment-childs chalt' ) ?> id="comment-<?php comment_ID() ?>"> <header> <h4><?php printf( __( '<div class="name">%s</div>' ), get_comment_author_link() ); ?> <a href="<?php echo htmlspecialchars( get_comment_link( $comment->comment_ID ) ); ?>"> <?php printf( __('<span class="time"><time datetime=" %1$s"> %2$s at %3$s </time></span>'), get_comment_date(), get_comment_date(),get_comment_time() ); ?></a> <?php edit_comment_link( __( '(Edit)' ), ' ', '' ); ?> <div class="clear"></div></h4> </header> <?php if ( $comment->comment_approved == '0' ) : ?> <em class="comment-awaiting-moderation">نظر شما منتظر تایید مدیر سایت می باشد</em> <br /> <?php endif; ?> <div class="comment-text"><?php comment_text(); ?> <p class="thdrpy"> <?php comment_reply_link( array_merge( $args, array( 'add_below' => $add_below, 'depth' => $depth, 'max_depth' => $args['max_depth'] ) ) ); ?></p> <div class="clear"></div></div> <?php if(empty( $args['has_children'])) echo ''; ?> <?php } add_action( 'post_submitbox_minor_actions', 'onlinewebsite_post_submitbox_minor_actions' ); function onlinewebsite_post_submitbox_minor_actions(){ global $post; ?> <div style="clear: both"></div> <script> jQuery( document ).on( 'click', '.ow_ajax_up', function() { jQuery('#action_up_status').html( 'در حال به روز رسانی' ); jQuery.ajax({ url : ajaxurl, type : 'post', data : { updateid: <?php echo $post->ID;?>, action : 'onlinewebsite_post_ajax_update', }, success : function( response ) { jQuery('#action_up_status').html( response ); setTimeout(function(){ jQuery('#action_status').html( '' ); }, 2000); } }); return false; }) </script> <div style="text-align: center;"><br><a href="#" class="button button-primary button-large ow_ajax_up">به روز رسانی تاریخ پست</a> </div> <div style="text-align: center;" id="action_up_status"></div> <?php } add_action( 'wp_ajax_onlinewebsite_post_ajax_update', 'onlinewebsite_post_ajax_update' ); function onlinewebsite_post_ajax_update(){ global $wpdb; $ow_updateid = $_POST['updateid']; $update = $wpdb->update( $wpdb->prefix . 'posts', array( 'post_date' => current_time( 'mysql' )), array( 'ID' => $ow_updateid ) ); if($update>0){ $uppm = '<span style="color: #42A81A">پست مورد نظر به روز شد</span>'; }else{ $uppm = '<span style="color: #E0004B">خطا در اجرای عملیات</span>'; } if(!empty($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest') { echo $uppm; } else { ob_start(); header("Location: ".get_bloginfo('url')); } die(); } add_filter( 'post_row_actions', 'wp_onlinewebsite_row_actions', 10, 2 ); function wp_onlinewebsite_row_actions( $actions, WP_Post $post ) { $actions['wpse8170-pdf'] = '<a href="#" upid="'.$post->ID.'" class="ow_ajax_up">به روز سانی</a>'; return $actions; } add_action( 'admin_footer-edit.php', 'ow_ajax_post_edit_page_footer' ); function ow_ajax_post_edit_page_footer(){ ?> <script> jQuery( document ).on( 'click', '.ow_ajax_up', function() { jQuery('#action_up_status').html( 'در حال به روز رسانی' ); jQuery.ajax({ url : ajaxurl, type : 'post', data : { updateid: jQuery(this).attr('upid'), action : 'onlinewebsite_post_ajax_update', }, success : function( response ) { alert( jQuery(response).text() ); } }); return false; }) </script> <?php } ?> نقل قول لینک به ارسال
bklink 0 ارسال شده در اردیبهشت 95 مالک گزارش بازنشر ارسال شده در اردیبهشت 95 آقا کمک کنید لطفاً نقل قول لینک به ارسال
imanfakhar 26231 ارسال شده در اردیبهشت 95 گزارش بازنشر ارسال شده در اردیبهشت 95 <?php add_action( 'after_setup_theme', 'fakhar_setup' ); if ( ! function_exists( 'fakhar_setup' ) ) : function fakhar_setup() { add_theme_support('post-thumbnails'); } endif; // fakhar_setup add_action( 'wp_enqueue_scripts', 'onlinewebsite_script_enqueuer' ); function onlinewebsite_script_enqueuer() { wp_enqueue_script( 'jquery' ); wp_register_script( "wp_onlinewebsite_js", get_bloginfo('template_directory').'/js/plugins.js', array('jquery') ); wp_enqueue_script('wp_onlinewebsite_js'); } require_once get_template_directory() . '/onlinewebsite/theme.php'; function twentyfifteen_widgets_init() { register_sidebar( array( 'name' => 'ابزارک کنار سایت', 'id' => 'sidebar-1', 'description' => 'ابزارک های مورد نظر را در این قسمت قرار دهید', 'before_widget' => '<section id="%1$s" class="widget aside collapse %2$s">', 'after_widget' => '</section>', 'before_title' => '<div class="title"><h3>', 'after_title' => '</h3></div>', ) ); } add_action( 'widgets_init', 'twentyfifteen_widgets_init' ); function onlinewebsite_theme_comment($comment, $args, $depth) { // print_r($comment); ?> <div <?php comment_class( ( $depth==1 ) ? 'commentset' : 'comment-childs chalt' ) ?> id="comment-<?php comment_ID() ?>"> <header> <h4><?php printf( __( '<div class="name">%s</div>' ), get_comment_author_link() ); ?> <a href="<?php echo htmlspecialchars( get_comment_link( $comment->comment_ID ) ); ?>"> <?php printf( __('<span class="time"><time datetime=" %1$s"> %2$s at %3$s </time></span>'), get_comment_date(), get_comment_date(),get_comment_time() ); ?></a> <?php edit_comment_link( __( '(Edit)' ), ' ', '' ); ?> <div class="clear"></div></h4> </header> <?php if ( $comment->comment_approved == '0' ) : ?> <em class="comment-awaiting-moderation">نظر شما منتظر تایید مدیر سایت می باشد</em> <br /> <?php endif; ?> <div class="comment-text"><?php comment_text(); ?> <p class="thdrpy"> <?php comment_reply_link( array_merge( $args, array( 'add_below' => $add_below, 'depth' => $depth, 'max_depth' => $args['max_depth'] ) ) ); ?></p> <div class="clear"></div></div> <?php if(empty( $args['has_children'])) echo ''; ?> <?php } add_action( 'post_submitbox_minor_actions', 'onlinewebsite_post_submitbox_minor_actions' ); function onlinewebsite_post_submitbox_minor_actions(){ global $post; ?> <div style="clear: both"></div> <script> jQuery( document ).on( 'click', '.ow_ajax_up', function() { jQuery('#action_up_status').html( 'در حال به روز رسانی' ); jQuery.ajax({ url : ajaxurl, type : 'post', data : { updateid: <?php echo $post->ID;?>, action : 'onlinewebsite_post_ajax_update', }, success : function( response ) { jQuery('#action_up_status').html( response ); setTimeout(function(){ jQuery('#action_status').html( '' ); }, 2000); } }); return false; }) </script> <div style="text-align: center;"><br><a href="#" class="button button-primary button-large ow_ajax_up">به روز رسانی تاریخ پست</a> </div> <div style="text-align: center;" id="action_up_status"></div> <?php } add_action( 'wp_ajax_onlinewebsite_post_ajax_update', 'onlinewebsite_post_ajax_update' ); function onlinewebsite_post_ajax_update(){ global $wpdb; $ow_updateid = $_POST['updateid']; $update = $wpdb->update( $wpdb->prefix . 'posts', array( 'post_date' => current_time( 'mysql' )), array( 'ID' => $ow_updateid ) ); if($update>0){ $uppm = '<span style="color: #42A81A">پست مورد نظر به روز شد</span>'; }else{ $uppm = '<span style="color: #E0004B">خطا در اجرای عملیات</span>'; } if(!empty($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest') { echo $uppm; } else { ob_start(); header("Location: ".get_bloginfo('url')); } die(); } add_filter( 'post_row_actions', 'wp_onlinewebsite_row_actions', 10, 2 ); function wp_onlinewebsite_row_actions( $actions, WP_Post $post ) { $actions['wpse8170-pdf'] = '<a href="#" upid="'.$post->ID.'" class="ow_ajax_up">به روز سانی</a>'; return $actions; } add_action( 'admin_footer-edit.php', 'ow_ajax_post_edit_page_footer' ); function ow_ajax_post_edit_page_footer(){ ?> <script> jQuery( document ).on( 'click', '.ow_ajax_up', function() { jQuery('#action_up_status').html( 'در حال به روز رسانی' ); jQuery.ajax({ url : ajaxurl, type : 'post', data : { updateid: jQuery(this).attr('upid'), action : 'onlinewebsite_post_ajax_update', }, success : function( response ) { alert( jQuery(response).text() ); } }); return false; }) </script> <?php } ?> نقل قول لینک به ارسال
پست های پیشنهاد شده
به گفتگو بپیوندید
هم اکنون می توانید مطلب خود را ارسال نمایید و بعداً ثبت نام کنید. اگر حساب کاربری دارید، برای ارسال با حساب کاربری خود اکنون وارد شوید .