رفتن به مطلب

ارور بعد زدن کد ابزارک


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

سلام

بچه ها بعد زدن کد ابزارک تو قالب بعضی قسمت ها اررور زیر میاد:

Warning: Cannot modify header information - headers already sent by (output started at /home/----/domains/-----/public_html/wp-content/themes/------/functions.php:209) in /home/------/domains/-------/public_html/wp-includes/pluggable.php on line 876

مشکل از کجاست؟؟

ویرایش شده توسط محمد هادی
لینک به ارسال

فک کنم جایی از کد ایراد داره، کدهای ابزارک آخر هستند:

<?php function catch_that_image() {

//for load the images in index

global $post, $posts;

$first_img = '';

ob_start();

ob_end_clean();

$output = preg_match_all('/<img.+src=[\'"]([^\'"]+)[\'"].*>/i', $post->post_content, $matches);

$first_img = $matches [1] [0];

if(empty($first_img)){ //Defines a default image

$first_img = "http://localhost/xam...mages/img.jpg";

}

return $first_img;

}

add_filter('wp_default_editor', create_function('', 'return "html";'));

add_filter('excerpt_length', 'ilc_excerpt_length');

function ilc_excerpt_length( $length ){

return 80;

}

// for popular posts whit out image

function popularPosts($num) {

global $wpdb;

$posts = $wpdb->get_results("SELECT comment_count, ID, post_title FROM $wpdb->posts ORDER BY comment_count DESC LIMIT 0 , $num");

foreach ($posts as $post) {

setup_postdata($post);

$id = $post->ID;

$title = $post->post_title;

$count = $post->comment_count;

if ($count != 0) {

$popular .= '<a href="' . get_permalink($id) . '" title="' . $title . '">' . $title . '</a> ';

}

}

return $popular;

}

// for popular posts whit out image

function popularPosts2($num) {

global $wpdb;

$posts = $wpdb->get_results("SELECT comment_count, ID, post_title FROM $wpdb->posts ORDER BY comment_count DESC LIMIT 0 , $num");

foreach ($posts as $post) {

setup_postdata($post);

$id = $post->ID;

$title = $post->post_title;

$count = $post->comment_count;

if ($count != 0) {

$popular .= '<li><a href="' . get_permalink($id) . '" title="' . $title . '">' . $title . '</a></li> ';

}

}

return $popular;

}

// for post date

function timeago()

{

$days = round((date('U') - get_the_time('U')) / (60*60*24));

if ($days==0) {

echo " امروز منتشر شد";

}

elseif ($days==1) {

echo "دیروز منتشر شد ";

}

else {

echo "" . $days . " روز پیش";

}

}

// for post view

function getPostViews($postID){

$count_key = 'post_views_count';

$count = get_post_meta($postID, $count_key, true);

if($count==''){

delete_post_meta($postID, $count_key);

add_post_meta($postID, $count_key, '0');

return "بدون بازدید";

}

return $count.' بازدید';

}

// function to count views.

function setPostViews($postID) {

$count_key = 'post_views_count';

$count = get_post_meta($postID, $count_key, true);

if($count==''){

$count = 0;

delete_post_meta($postID, $count_key);

add_post_meta($postID, $count_key, '0');

}else{

$count++;

update_post_meta($postID, $count_key, $count);

}

}

//for post view in wp admin

add_filter('manage_posts_columns', 'posts_column_views');

add_action('manage_posts_custom_column', 'posts_custom_column_views',5,2);

function posts_column_views($defaults){

$defaults['post_views'] = __('بازدید');

return $defaults;

}

function posts_custom_column_views($column_name, $id){

if($column_name === 'post_views'){

echo getPostViews(get_the_ID());

}

}

//for removie [...] in index

function wpe_excerptlength_incats( $length ) {

return 45;

}

function wpe_excerptlength_index( $length ) {

return 70;

}

function wpe_excerptmore( $more ) {

return '  . . .';

}

function wpe_excerpt( $length_callback = '', $more_callback = '' ) {

if ( function_exists( $length_callback ) )

add_filter( 'excerpt_length', $length_callback );

if ( function_exists( $more_callback ) )

add_filter( 'excerpt_more', $more_callback );

$output = get_the_excerpt();

$output = apply_filters( 'wptexturize', $output );

$output = apply_filters( 'convert_chars', $output );

$output = '<p>' . $output . '</p>'; // maybe wpautop( $foo, $br )

echo $output;

}

//for block spam comments

function delete_comment_link($id) {

if (current_user_can('edit_post')) {

echo '| <a href="'.admin_url("comment.php?action=cdc&c=$id").'" style="color:#f00;" >حذف</a> ';

echo '| <a href="'.admin_url("comment.php?action=cdc&dt=spam&c=$id").'">جفنگ</a>';

}

}

//delete url in comment-content

// This will occur when the comment is posted

function plc_comment_post( $incoming_comment ) {

// convert everything in a comment to display literally

$incoming_comment['comment_content'] = htmlspecialchars($incoming_comment['comment_content']);

// the one exception is single quotes, which cannot be #039; because WordPress marks it as spam

$incoming_comment['comment_content'] = str_replace( "'", ''', $incoming_comment['comment_content'] );

return( $incoming_comment );

}

// This will occur before a comment is displayed

function plc_comment_display( $comment_to_display ) {

// Put the single quotes back in

$comment_to_display = str_replace( ''', "'", $comment_to_display );

return $comment_to_display;

}

add_filter( 'preprocess_comment', 'plc_comment_post', '', 1 );

add_filter( 'comment_text', 'plc_comment_display', '', 1 );

add_filter( 'comment_text_rss', 'plc_comment_display', '', 1 );

add_filter( 'comment_excerpt', 'plc_comment_display', '', 1 );

// This stops WordPress from trying to automatically make hyperlinks on text:

remove_filter( 'comment_text', 'make_clickable', 9 );

//baraye didgah haye to dar to

function enable_threaded_comments(){

if (!is_admin()) {

if (is_singular() AND comments_open() AND (get_option('thread_comments') == 1))

wp_enqueue_script('comment-reply');

}

}

add_action('get_header', 'enable_threaded_comments');

// delete generator in header

add_filter('the_generator', create_function('', 'return "";'));

// for show page number

function wp_corenavi() {

global $wp_query, $wp_rewrite;

$pages = '';

$max = $wp_query->max_num_pages;

if (!$current = get_query_var('paged')) $current = 1;

$a['base'] = str_replace(999999999, '%#%', get_pagenum_link(999999999));

$a['total'] = $max;

$a['current'] = $current;

$total = 1; //1 - display the text "Page N of N", 0 - not display

$a['mid_size'] = 5; //how many links to show on the left and right of the current

$a['end_size'] = 1; //how many links to show in the beginning and end

$a['prev_text'] = '« قبلی'; //text of the "Previous page" link

$a['next_text'] = 'بعدی »'; //text of the "Next page" link

if ($max > 1) echo '<div class="navigation">';

echo $pages . paginate_links($a);

if ($max > 1) echo '</div>';

}

?>

<?php

if ( function_exists('register_sidebar') )

register_sidebar();

?>

<?php

if ( function_exists('register_sidebar') )

register_sidebar(array('name'=>'Sidebar1',

'before_widget' => '<div class="sidebar_bg ads_first">',

'after_widget' => '</div>',

'before_title' => '<h3>',

'after_title' => '</h3>',

));

register_sidebar(array('name'=>'Sidebar2',

'before_widget' => '<div class="sidebar_bg ads_first">',

'after_widget' => '</div>',

'before_title' => '<h3>',

'after_title' => '</h3>',

));

?>

ویرایش شده توسط Morteza
لینک به ارسال

headers already sent رو توی انجمن جستجو کنید

چندین بار مطرح شده..........

لینک به ارسال

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

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

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

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

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

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

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

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

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