رفتن به مطلب

ارور عجیب پس از تغییرات


پست های پیشنهاد شده

سلام

من وقتی از توی وردپرس ویرایشگر تغییری انجام میدم بعد ذخیره رو میزنم به یه صفحه میاد که نوشته زیر توشته :

Warning: Cannot modify header information - headers already sent by (output started at /home3/mysite/public_html/wp-content/themes/mytheme/functions.php:202) in /home3/mysite/public_html/wp-includes/pluggable.php on line 1196

لینک به ارسال

مشکل احتمالا یا از افزونه های شما میباشند ، یا از functions.php .

بهتر هست فایل functions.php خود را برای ما ارسال کنید تا بررسی کنیم و نتیجه را به شما ارسال کنیم .

موفق باشید .

لینک به ارسال

<?php
include "metabox.php";
include "widget.php";
require( get_template_directory() . '/admin/functions.php' );
add_theme_support('post-thumbnails');
if ( function_exists('register_sidebar') )
register_sidebar(array(
'name' => 'Widget',
'before_widget' => '<div class="side lside">',
'after_widget' => '</div>',
'before_title' => '<div class="titlerside"><span>',
'after_title' => '</span></div>',
));

function NESTED_thumb_image(){
if ( has_post_thumbnail() ) {
the_post_thumbnail( 'NESTED_thumb', array('class' => 'test') );
} else {
};
}
if(!function_exists(add_theme_support)){
add_theme_support('menus');
}
function register_my_menus()
{
register_nav_menus(
array(
'top-menu'=>__('منو بالا')
)
);
}
add_action('init','register_my_menus');

function 20script_comment( $comment, $args, $depth ) {
$GLOBALS['comment'] = $comment;
switch ( $comment->comment_type ) :
case 'pingback' :
case 'trackback' :
// Display trackbacks differently than normal comments.
?>

<li <?php comment_class(); ?> id="comment-<?php comment_ID(); ?>">
<p><?php _e( 'Pingback:', '20script' ); ?> <?php comment_author_link(); ?> <?php edit_comment_link( __( '(Edit)', '20script' ), '<span class="edit-link">', '</span>' ); ?></p>
<?php
break;
default :
// Proceed with normal comments.
global $post;

//Check Whether the comment is a Respond or Not
global $wpdb;
$get_comment_ID = get_comment_ID();
$respond_query = "SELECT * FROM $wpdb->comments
WHERE comment_ID = {$get_comment_ID}";
$rsp = $wpdb->get_results($respond_query);

?>

<div class="comment row<?php foreach ($rsp as $rs) {
if($rs->comment_parent == 0) : echo ""; else : echo " replied"; endif;

} ?>" id="li-comment-<?php comment_ID(); ?>">

<div class="avatar-reply col">
<?php echo get_avatar( $comment, 100 ); ?>
</div>
<div class="comment-body">
<div class="comment-body-top row">
<a class="author" href="<?php comment_author_url(); ?>" rel="nofollow" title="مشاهده وب سایت <?php comment_author(); ?>"><?php comment_author(); ?></a>
<?php if ( '0' == $comment->comment_approved ) : ?>
<p class="comment-awaiting-moderation"><?php _e( 'دیدگاه شما پس از تایید مدیر نمایش داده خواهد شد', '20script' ); ?></p>
<?php endif; ?>
<span class="date"><?php comment_date(__('jS F, Y','kubrick')) ?> </span>
</div>
<p id="comment-<?php comment_ID(); ?>" class="comment-texttt">

<section class="comment-content">
<?php comment_text(); ?>
<?php edit_comment_link( __( 'Edit', '20script' ), '<p class="edit-link">', '</p>' ); ?>
</section><!-- .comment-content -->
<span class="pasokh"><?php comment_reply_link( array_merge( $args, array( 'reply_text' => __( 'پاسخ دهید', '20script' ), 'after' => '', 'depth' => $depth, 'max_depth' => $args['max_depth'] ) ) ); ?> </span>

</p><!-- #comment-## -->
</div>

</div>
<?php
break;
endswitch; // end comment_type check
}

function 20script_comment_form( $args = array(), $post_id = null ) {
global $id;
if ( null === $post_id )
$post_id = $id;
else
$id = $post_id;
$commenter = wp_get_current_commenter();
$user = wp_get_current_user();
$user_identity = $user->exists() ? $user->display_name : '';
$req = get_option( 'require_name_email' );
$aria_req = ( $req ? " aria-required='true'" : '' );
$fields = array(
'author' => '<input class="send-form-input" id="author" name="author" type="text" value="' . esc_attr( $commenter['comment_author'] ) . '"' . $aria_req . ' placeholder="نام و نام خانوادگی : ">',
'email' => '<input class="send-form-input" id="email" name="email" type="text" value="' . esc_attr( $commenter['comment_author_email'] ) . '"' . $aria_req . ' placeholder="ایمیل : ">',
'url' => '<input class="send-form-input" id="url" name="url" type="text" value="' . esc_attr( $commenter['comment_author_url'] ) . '" placeholder="وب سایت : ">',
);
$defaults = array(
'fields' => apply_filters( 'comment_form_default_fields', $fields ),
'comment_field' => '<textarea class="comment-texttt" id="comment" name="comment" aria-required="true" placeholder="متن : "></textarea>',
'must_log_in' => '<p class="must-log-in">' . sprintf( __( 'You must be <a href="%s">logged in</a> to post a comment.' ), wp_login_url( apply_filters( 'the_permalink', get_permalink( $post_id ) ) ) ) . '</p>',
'logged_in_as' => '<p class="logged-in-as">' . sprintf( __( 'Logged in as <a href="%1$s">%2$s</a>. <a href="%3$s" title="Log out of this account">Log out?</a>' ), get_edit_user_link(), $user_identity, wp_logout_url( apply_filters( 'the_permalink', get_permalink( $post_id ) ) ) ) . '</p>',
'comment_notes_before' => '<p class="comment-notes">' . __( 'Your email address will not be published.' ) . ( $req ? $required_text : '' ) . '</p>',
'id_form' => 'commentform',
'id_submit' => 'submit',
'title_reply' => __( 'Leave a Reply' ),
'title_reply_to' => __( 'Leave a Reply to %s' ),
'cancel_reply_link' => __( 'Cancel reply' ),
'label_submit' => __( 'Post Comment' ),
);
$args = wp_parse_args( $args, apply_filters( 'comment_form_defaults', $defaults ) );
if ( comments_open( $post_id ) ) :
do_action( 'comment_form_before' ); ?>
<div id="respond">
<small><?php cancel_comment_reply_link( $args['cancel_reply_link'] ); ?></small>
<div style="position:relative;">
<?php if ( get_option( 'comment_registration' ) && !is_user_logged_in() ) : ?>
<?php echo $args['must_log_in']; ?>
<?php do_action( 'comment_form_must_log_in_after' ); ?>
<?php else : ?>
<form action="<?php echo site_url( '/wp-comments-post.php' ); ?>" method="post" id="<?php echo esc_attr( $args['id_form'] ); ?>">
<?php do_action( 'comment_form_top' ); ?>
<?php if ( is_user_logged_in() ) : ?>
<script>
$("#respond").addClass("comment-as-logged-in-user");
</script>
<?php echo apply_filters( 'comment_form_logged_in', $args['logged_in_as'], $commenter, $user_identity ); ?>
<?php do_action( 'comment_form_logged_in_after', $commenter, $user_identity ); ?>
<?php else : ?>
<?php
do_action( 'comment_form_before_fields' );
foreach ( (array) $args['fields'] as $name => $field ) {
echo apply_filters( "comment_form_field_{$name}", $field ) . "\n";
}
do_action( 'comment_form_after_fields' );
?>
<?php endif; ?>
<?php echo apply_filters( 'comment_form_field_comment', $args['comment_field'] ); ?>
<?php echo $args['comment_notes_after']; ?>

<input name="submit" type="submit" id="<?php echo esc_attr( $args['id_submit'] ); ?>" value="ارسال دیدگاه" class="send_comment_form_submit">
<?php comment_id_fields( $post_id ); ?>

<?php do_action( 'comment_form', $post_id ); ?>
</form>
<?php endif; ?>
</div>
</div><!-- #respond -->
<!-- www.20script.ir -->
<?php else : do_action( 'comment_form_comments_closed' ); endif; }?>

لینک به ارسال

کدهای function اینه و اروری که میده :

Fatal error: Cannot redeclare title() (previously declared in /home3/mysitee/public_html/wp-content/themes/farsifa-finally/functions.php:16) in /home3/mysitee/public_html/wp-content/themes/testt/functions.php on line 20


<?php
include "metabox.php";
include "widget.php";
require( get_template_directory() . '/admin/functions.php' );
add_theme_support('post-thumbnails');
if ( function_exists('register_sidebar') )
register_sidebar(array(
'name' => 'Widget',
'before_widget' => '<div class="side lside">',
'after_widget' => '</div>',
'before_title' => '<div class="titlerside"><span>',
'after_title' => '</span></div>',
));
function title($char) {
$title = get_the_title($post->ID);
$title = substr($title,0,$char);
echo $title;
}

function NESTED_thumb_image(){
if ( has_post_thumbnail() ) {
the_post_thumbnail( 'NESTED_thumb', array('class' => 'test') );
} else {
};
}
if(!function_exists(add_theme_support)){
add_theme_support('menus');
}
function register_my_menus()
{
register_nav_menus(
array(
'top-menu'=>__('منو بالا')
)
);
}
add_action('init','register_my_menus');
function 20script_comment( $comment, $args, $depth ) {
$GLOBALS['comment'] = $comment;
switch ( $comment->comment_type ) :
case 'pingback' :
case 'trackback' :
// Display trackbacks differently than normal comments.
?>

<li <?php comment_class(); ?> id="comment-<?php comment_ID(); ?>">
<p><?php _e( 'Pingback:', '20script' ); ?> <?php comment_author_link(); ?> <?php edit_comment_link( __( '(Edit)', '20script' ), '<span class="edit-link">', '</span>' ); ?></p>
<?php
break;
default :
// Proceed with normal comments.
global $post;

//Check Whether the comment is a Respond or Not
global $wpdb;
$get_comment_ID = get_comment_ID();
$respond_query = "SELECT * FROM $wpdb->comments
WHERE comment_ID = {$get_comment_ID}";
$rsp = $wpdb->get_results($respond_query);

?>

<div class="comment row<?php foreach ($rsp as $rs) {
if($rs->comment_parent == 0) : echo ""; else : echo " replied"; endif;

} ?>" id="li-comment-<?php comment_ID(); ?>">

<div class="avatar-reply col">
<?php echo get_avatar( $comment, 100 ); ?>
</div>
<div class="comment-body">
<div class="comment-body-top row">
<a class="author" href="<?php comment_author_url(); ?>" rel="nofollow" title="مشاهده وب سایت <?php comment_author(); ?>"><?php comment_author(); ?></a>
<?php if ( '0' == $comment->comment_approved ) : ?>
<p class="comment-awaiting-moderation"><?php _e( 'دیدگاه شما پس از تایید مدیر نمایش داده خواهد شد', '20script' ); ?></p>
<?php endif; ?>
<span class="date"><?php comment_date(__('jS F, Y','kubrick')) ?> </span>
</div>
<p id="comment-<?php comment_ID(); ?>" class="comment-texttt">

<section class="comment-content">
<?php comment_text(); ?>
<?php edit_comment_link( __( 'Edit', '20script' ), '<p class="edit-link">', '</p>' ); ?>
</section><!-- .comment-content -->
<span class="pasokh"><?php comment_reply_link( array_merge( $args, array( 'reply_text' => __( 'پاسخ دهید', '20script' ), 'after' => '', 'depth' => $depth, 'max_depth' => $args['max_depth'] ) ) ); ?> </span>

</p><!-- #comment-## -->
</div>

</div>
<?php
break;
endswitch; // end comment_type check
}

function 20script_comment_form( $args = array(), $post_id = null ) {
global $id;
if ( null === $post_id )
$post_id = $id;
else
$id = $post_id;
$commenter = wp_get_current_commenter();
$user = wp_get_current_user();
$user_identity = $user->exists() ? $user->display_name : '';
$req = get_option( 'require_name_email' );
$aria_req = ( $req ? " aria-required='true'" : '' );
$fields = array(
'author' => '<input class="send-form-input" id="author" name="author" type="text" value="' . esc_attr( $commenter['comment_author'] ) . '"' . $aria_req . ' placeholder="نام و نام خانوادگی : ">',
'email' => '<input class="send-form-input" id="email" name="email" type="text" value="' . esc_attr( $commenter['comment_author_email'] ) . '"' . $aria_req . ' placeholder="ایمیل : ">',
'url' => '<input class="send-form-input" id="url" name="url" type="text" value="' . esc_attr( $commenter['comment_author_url'] ) . '" placeholder="وب سایت : ">',
);
$defaults = array(
'fields' => apply_filters( 'comment_form_default_fields', $fields ),
'comment_field' => '<textarea class="comment-texttt" id="comment" name="comment" aria-required="true" placeholder="متن : "></textarea>',
'must_log_in' => '<p class="must-log-in">' . sprintf( __( 'You must be <a href="%s">logged in</a> to post a comment.' ), wp_login_url( apply_filters( 'the_permalink', get_permalink( $post_id ) ) ) ) . '</p>',
'logged_in_as' => '<p class="logged-in-as">' . sprintf( __( 'Logged in as <a href="%1$s">%2$s</a>. <a href="%3$s" title="Log out of this account">Log out?</a>' ), get_edit_user_link(), $user_identity, wp_logout_url( apply_filters( 'the_permalink', get_permalink( $post_id ) ) ) ) . '</p>',
'comment_notes_before' => '<p class="comment-notes">' . __( 'Your email address will not be published.' ) . ( $req ? $required_text : '' ) . '</p>',
'id_form' => 'commentform',
'id_submit' => 'submit',
'title_reply' => __( 'Leave a Reply' ),
'title_reply_to' => __( 'Leave a Reply to %s' ),
'cancel_reply_link' => __( 'Cancel reply' ),
'label_submit' => __( 'Post Comment' ),
);
$args = wp_parse_args( $args, apply_filters( 'comment_form_defaults', $defaults ) );
if ( comments_open( $post_id ) ) :
do_action( 'comment_form_before' ); ?>
<div id="respond">
<small><?php cancel_comment_reply_link( $args['cancel_reply_link'] ); ?></small>
<div style="position:relative;">
<?php if ( get_option( 'comment_registration' ) && !is_user_logged_in() ) : ?>
<?php echo $args['must_log_in']; ?>
<?php do_action( 'comment_form_must_log_in_after' ); ?>
<?php else : ?>
<form action="<?php echo site_url( '/wp-comments-post.php' ); ?>" method="post" id="<?php echo esc_attr( $args['id_form'] ); ?>">
<?php do_action( 'comment_form_top' ); ?>
<?php if ( is_user_logged_in() ) : ?>
<script>
$("#respond").addClass("comment-as-logged-in-user");
</script>
<?php echo apply_filters( 'comment_form_logged_in', $args['logged_in_as'], $commenter, $user_identity ); ?>
<?php do_action( 'comment_form_logged_in_after', $commenter, $user_identity ); ?>
<?php else : ?>
<?php
do_action( 'comment_form_before_fields' );
foreach ( (array) $args['fields'] as $name => $field ) {
echo apply_filters( "comment_form_field_{$name}", $field ) . "\n";
}
do_action( 'comment_form_after_fields' );
?>
<?php endif; ?>
<?php echo apply_filters( 'comment_form_field_comment', $args['comment_field'] ); ?>
<?php echo $args['comment_notes_after']; ?>

<input name="submit" type="submit" id="<?php echo esc_attr( $args['id_submit'] ); ?>" value="ارسال دیدگاه" class="send_comment_form_submit">
<?php comment_id_fields( $post_id ); ?>

<?php do_action( 'comment_form', $post_id ); ?>
</form>
<?php endif; ?>
</div>
</div><!-- #respond -->
<!-- www.20script.ir -->
<?php else : do_action( 'comment_form_comments_closed' ); endif; }?>

لینک به ارسال

پوسته‌هاتون با هم تداخل دارن، احتمالاً شما یه پوسته فرزند ایجاد کردید، درسته؟

اگه پوسته فرزند ایجاد کردید، دیگه نیازی به کپی کل فایل functions.php ندارید. ولی در کل راه حل این مشکل، حذف این قسمت از کد هست:


function title($char) {
$title = get_the_title($post->ID);
$title = substr($title,0,$char);
echo $title;
}


موفق باشید

لینک به ارسال

پوسته فرزند یه پوسته هست که زیرمجموعه یه پوسته دیگه هست و تمام اطلاعات و سبکش رو از اون پوسته میگیره.

شما باید توی پوسته testt، فایل functions.phpتون رو حذف کنید.

موفق باشید.

لینک به ارسال

به گفتگو بپیوندید

هم اکنون می توانید مطلب خود را ارسال نمایید و بعداً ثبت نام کنید. اگر حساب کاربری دارید، برای ارسال با حساب کاربری خود اکنون وارد شوید .

مهمان
ارسال پاسخ به این موضوع ...

×   شما در حال چسباندن محتوایی با قالب بندی هستید.   حذف قالب بندی

  تنها استفاده از 75 اموجی مجاز می باشد.

×   لینک شما به صورت اتوماتیک جای گذاری شد.   نمایش به صورت لینک

×   محتوای قبلی شما بازگردانی شد.   پاک کردن محتوای ویرایشگر

×   شما مستقیما نمی توانید تصویر خود را قرار دهید. یا آن را اینجا بارگذاری کنید یا از یک URL قرار دهید.

×
×
  • اضافه کردن...