رفتن به مطلب

از کار افتادن سایت مپ و دادن ارور


runy

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

سلام

سایت مپ من از کار افتاده و من خیلی وقته نفهمیدم . وقتی آدرس سایت مپ را میزنم این ارور را میده:


This page contains the following errors:
error on line 3 at column 6: XML declaration allowed only at the start of the document
Below is a rendering of the page up to the first error.

ادر س سایت مپم :


http://nedaj.ir/sitemapindex.xml/

از افزونه Google XML Sitemaps اتفاده میکنم

باید چه کنم سایت مپم درست بشه ؟؟

هر کاری میکنم نمیشه احتمال میدم با چیزی تداخل داره ولی با چی نمی دونم.

لینک به ارسال

سلام

فایل functions قالبتون را برسی کنید احتمالا از همین است.

موفق باشید/.

دوست عزیز دقیقا باید کجاش را بررسی کنم ؟؟؟

من نمیفهمم به تابع های پوسته چه کار داره؟؟؟

کل محتوای functions من در زیر آوردم :


<?php
if (function_exists('add_theme_support')) {
add_theme_support('post-thumbnails');
add_image_size('app1', 150, 150, true);
add_image_size('app2', 350, 350, true);
add_image_size('app3', 300, 160, true);
add_image_size('app4', 58, 58, true);
function insert_last_login( $login ) {
global $user_id;
$user = get_userdatabylogin( $login );
update_user_meta( $user->ID, 'last_login', gmdate( 'Y-m-d H:i:s' ), the_time('Y-m-j') );
}
add_action( 'wp_login', 'insert_last_login' );
function add_last_login_column( $columns ) {
$columns['last_login'] = __( 'آخرین ورود', 'last_login' );
return $columns;
}
add_filter( 'manage_users_columns', 'add_last_login_column' );
function add_last_login_column_value( $value, $column_name, $user_id ) {
$user = get_userdata( $user_id );
if ( 'last_login' == $column_name && $user->last_login )
$value = jdate( 'Y/m/d g:ia', strtotime( $user->last_login ) );
return $value;
}
add_action( 'manage_users_custom_column', 'add_last_login_column_value', 10, 3 );
}
if ( function_exists('register_sidebar') )
register_sidebar();
if ( function_exists('register_sidebar') )
register_sidebar(array('name'=>'pivand',
'before_widget' => '',
'after_widget' => '',
'before_title' => '<h3>',
'after_title' => '</h3>',
));
register_sidebar(array('name'=>'خدمات',
'before_widget' => '',
'after_widget' => '',
'before_title' => '<h3>',
'after_title' => '</h3>',
));
register_sidebar(array('name'=>'Sidebar2',
'before_widget' => '',
'after_widget' => '',
'before_title' => '<h3>',
'after_title' => '</h3>',
));
register_sidebar(array('name'=>'Sidebar3',
'before_widget' => '',
'after_widget' => '',
'before_title' => '<h3>',
'after_title' => '</h3>',
));
register_sidebar(array('name'=>'Sidebar4',
'before_widget' => '',
'after_widget' => '',
'before_title' => '<h3>',
'after_title' => '</h3>',
));
register_sidebar(array('name'=>'footer1',
'before_widget' => '',
'after_widget' => '',
'before_title' => '<h3>',
'after_title' => '</h3>',
));
register_sidebar(array('name'=>'footer2',
'before_widget' => '',
'after_widget' => '',
'before_title' => '<h3>',
'after_title' => '</h3>',
));
register_sidebar(array('name'=>'footer3',
'before_widget' => '',
'after_widget' => '',
'before_title' => '<h3>',
'after_title' => '</h3>',
));
register_sidebar(array('name'=>'footer4',
'before_widget' => '',
'after_widget' => '',
'before_title' => '<h3>',
'after_title' => '</h3>',
));

function register_my_menus() {
register_nav_menus(
array(
'top-menu' => __( 'فهرست بالا' )
)
);
}
add_action( 'init', 'register_my_menus' );
// Register Footer Sidebar
register_sidebar(array(
'id' => 'sidebar_footer',
'name' => 'Sidebar Footer',
'before_title' => "<h6>",
'after_title' => '</h6>'
));
add_action('wp_enqueue_scripts', 'cssmenumaker_scripts_styles' );
function cssmenumaker_scripts_styles() {
wp_enqueue_style( 'cssmenu-styles', get_template_directory_uri() . '/cssmenu/styles.css');
wp_enqueue_script('cssmenu-scripts', get_template_directory_uri() . '/cssmenu/script.js');
}
class CSS_Menu_Maker_Walker extends Walker {
var $db_fields = array( 'parent' => 'menu_item_parent', 'id' => 'db_id' );

function start_lvl( &$output, $depth = 0, $args = array() ) {
$indent = str_repeat("\t", $depth);
$output .= "\n$indent<ul>\n";
}

function end_lvl( &$output, $depth = 0, $args = array() ) {
$indent = str_repeat("\t", $depth);
$output .= "$indent</ul>\n";
}

function start_el( &$output, $item, $depth = 0, $args = array(), $id = 0 ) {

global $wp_query;
$indent = ( $depth ) ? str_repeat( "\t", $depth ) : '';
$class_names = $value = '';
$classes = empty( $item->classes ) ? array() : (array) $item->classes;

/* Add active class */
if(in_array('current-menu-item', $classes)) {
$classes[] = 'active';
unset($classes['current-menu-item']);
}
/* Check for children */
$children = get_posts(array('post_type' => 'nav_menu_item', 'nopaging' => true, 'numberposts' => 1, 'meta_key' => '_menu_item_menu_item_parent', 'meta_value' => $item->ID));
if (!empty($children)) {
$classes[] = 'has-sub';
}
$class_names = join( ' ', apply_filters( 'nav_menu_css_class', array_filter( $classes ), $item, $args ) );
$class_names = $class_names ? ' class="' . esc_attr( $class_names ) . '"' : '';

$id = apply_filters( 'nav_menu_item_id', 'menu-item-'. $item->ID, $item, $args );
$id = $id ? ' id="' . esc_attr( $id ) . '"' : '';

$output .= $indent . '<li' . $id . $value . $class_names .'>';

$attributes = ! empty( $item->attr_title ) ? ' title="' . esc_attr( $item->attr_title ) .'"' : '';
$attributes .= ! empty( $item->target ) ? ' target="' . esc_attr( $item->target ) .'"' : '';
$attributes .= ! empty( $item->xfn ) ? ' rel="' . esc_attr( $item->xfn ) .'"' : '';
$attributes .= ! empty( $item->url ) ? ' href="' . esc_attr( $item->url ) .'"' : '';

$item_output = $args->before;
$item_output .= '<a'. $attributes .'><span>';
$item_output .= $args->link_before . apply_filters( 'the_title', $item->title, $item->ID ) . $args->link_after;
$item_output .= '</span></a>';
$item_output .= $args->after;

$output .= apply_filters( 'walker_nav_menu_start_el', $item_output, $item, $depth, $args );
}

function end_el( &$output, $item, $depth = 0, $args = array() ) {
$output .= "</li>\n";
}
}
/* THIS INCLUDES THE THUMBNAIL IN OUR RSS FEED*/
function insertThumbnailRSS($content) {
global $post;
if ( has_post_thumbnail( $post->ID ) ){
$content = '' . get_the_post_thumbnail( $post->ID, 'thumbnail', array( 'alt' => get_the_title(), 'title' => get_the_title(), 'style' => 'float:right;' ) ) . '' . $content;
}
return $content;
}
add_filter('the_excerpt_rss', 'insertThumbnailRSS');
add_filter('the_content_feed', 'insertThumbnailRSS');
function change_user_contact_information( $fields )
{
$fields['twitter'] = 'توييتر';
$fields['facebook'] = 'فيسبوک';
$fields['googleplus'] = 'گوگل پلاس';
$fields['linkedin'] = 'لينکداين';
$fields['skype'] = 'اسکايپ';

return $fields;
}
add_filter('user_contactmethods', 'change_user_contact_information');

function nofollow_cat_posts($text) {
global $post;
if( in_category(1) ) { // SET CATEGORY ID HERE
$text = stripslashes(wp_rel_nofollow($text));
}
return $text;
}
add_filter('the_content', 'nofollow_cat_posts');
function new_excerpt_more($more) {
global $post;
return '… <a href="'. get_permalink($post->ID) . '">' . 'ادامه نوشته »' . '</a>';
}
add_filter('excerpt_more', 'new_excerpt_more');
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);
}
}
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());
}
}
/* نمایش تاریخ انتشار مطلب */
add_filter('the_time', 'timeago');
function timeago()
{
global $post;
$date = $post->post_date;
$time = get_post_time('G', true, $post);
$time_diff = time() - $time;
if ( $time_diff > 0 && $time_diff < 24*60*60 )
$display = sprintf( __('%s پیش'), human_time_diff( $time ) );
else
$display = date(get_option('date_format'), strtotime($date) );
return $display;
}
?>

لینک به ارسال

سلام

مشکلم در لینک زیر حل شد اگر کسی مشکل من را یدا کرد به لینک زیر برود :


http://wp-help.ir/Thread-%D8%A7%D8%B2-%DA%A9%D8%A7%D8%B1-%D8%A7%D9%81%D8%AA%D8%A7%D8%AF%D9%86-%D8%B3%D8%A7%DB%8C%D8%AA-%D9%85%D9%BE-%D9%88-%D8%AF%D8%A7%D8%AF%D9%86-%D8%A7%D8%B1%D9%88%D8%B1

لینک به ارسال
  • 1 ماه بعد...

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

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

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

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

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

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

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

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

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