سلام
من با function.php یک مشکلی پیدا کردم که وقتی با www سایت رو باز میکنم این خطا رو میده
Warning: Cannot modify header information - headers already sent by (output started at /home/*****/domains/****/public_html/wp-content/themes/*****/functions.php:45) in /home/*****/domains/*******/public_html/wp-includes/pluggable.php on line 934
wp-login.php هم بالاش همین ارور رو میده ، موقع ثبت نام کاربر جدید هم همینطور
محتویات فایل function.php
<?php
function catch_that_image() {
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];
return $first_img;
}
function limit_words($string, $word_limit) {
$words = explode(' ', $string);
return implode(' ', array_slice($words, 0, $word_limit));
}
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);
}
}
?>