Title: Не могу отключить автоматическое форматирование
Last modified: 31.07.2016

---

# Не могу отключить автоматическое форматирование

 *  Решено [phnataly](https://ru.wordpress.org/support/users/phnataly/)
 * (@phnataly)
 * [11 лет, 5 месяцев назад](https://ru.wordpress.org/support/topic/%d0%bd%d0%b5-%d0%bc%d0%be%d0%b3%d1%83-%d0%be%d1%82%d0%ba%d0%bb%d1%8e%d1%87%d0%b8%d1%82%d1%8c-%d0%b0%d0%b2%d1%82%d0%be%d0%bc%d0%b0%d1%82%d0%b8%d1%87%d0%b5%d1%81%d0%ba%d0%be%d0%b5-%d1%84%d0%be%d1%80/)
 * На главной странице в анонсах записей обрезается форматированный текст: не отображаются
   ни подчеркивания ни ссылки и прочее.
    в functions.php
 *     ```
       if (!function_exists('g7_entry_content')) {
           function g7_entry_content() {
               $content_type   = g7_meta('blog_content', 1);
               $excerpt_length = g7_meta('blog_excerpt', 60);
               $post_content   = g7_post_content($content_type, $excerpt_length);
               $content        = '';
               if ($post_content) {
                   $content = '<div class="entry-content">' . $post_content . '</div>';
               }
               return $content;
           }
       }
   
       if (!function_exists('g7_entry_content')) {
           function g7_entry_content() {
               $content_type   = g7_meta('blog_content', 1);
               $excerpt_length = g7_meta('blog_excerpt', 60);
               $post_content   = g7_post_content($content_type, $excerpt_length);
               $content        = '';
               if ($post_content) {
                   $content = '<div class="entry-content">' . $post_content . '</div>';
               }
               return $content;
           }
       }
       ```
   
 * в index.php анонсы выводятся
 *     ```
       <?php if (have_posts()) : ?>
   
       		<div class="posts blog-small">
       			<?php while (have_posts()) : the_post(); ?>
       				<?php get_template_part('content', 'small'); ?>
       			<?php endwhile; ?>
       		</div>
   
       		<?php g7_pagination(); ?>
   
       	<?php else: ?>
   
       		<?php get_template_part('content', 'none'); ?>
   
       	<?php endif; ?>
       ```
   
 * шаблон contetn-small.php
 *     ```
       <?php if (g7_meta('blog_show_image', 1) && has_post_thumbnail()) : ?>
       		<span class="entry-image">
       			<?php echo g7_image($image_w, $image_h); ?>
       		</span>
       	<?php endif; ?>
       <?php echo g7_entry_content(); ?>
       ```
   
 * Пробовала везде заменять на excerpt — не получается отключить через functions
   форматирование не работает. Плагинами тоже не решается проблема.

Просмотр 11 ответов — с 1 по 11 (всего 11)

 *  [Flector](https://ru.wordpress.org/support/users/flector/)
 * (@flector)
 * [11 лет, 5 месяцев назад](https://ru.wordpress.org/support/topic/%d0%bd%d0%b5-%d0%bc%d0%be%d0%b3%d1%83-%d0%be%d1%82%d0%ba%d0%bb%d1%8e%d1%87%d0%b8%d1%82%d1%8c-%d0%b0%d0%b2%d1%82%d0%be%d0%bc%d0%b0%d1%82%d0%b8%d1%87%d0%b5%d1%81%d0%ba%d0%be%d0%b5-%d1%84%d0%be%d1%80/#post-171399)
 * в анонсах разметка вырезается всегда.
    ну кроме случаях с заполненной цитатой.
 * вот так замените код:
 *     ```
       if (!function_exists('g7_entry_content')) {
           function g7_entry_content() {
               $content_type   = g7_meta('blog_content', 1);
               $excerpt_length = g7_meta('blog_excerpt', 60);
               $content = get_post_field('post_content', get_the_ID());
               $content_parts = get_extended($content);
               $content        = '';
               if ($post_content) {
                   $content = '<div class="entry-content">' . $content_parts['main'] . '</div>';
               }
               return $content;
           }
       }
       ```
   
 * записи будут резаться до тега more, с сохранением разметки.
 *  Автор [phnataly](https://ru.wordpress.org/support/users/phnataly/)
 * (@phnataly)
 * [11 лет, 5 месяцев назад](https://ru.wordpress.org/support/topic/%d0%bd%d0%b5-%d0%bc%d0%be%d0%b3%d1%83-%d0%be%d1%82%d0%ba%d0%bb%d1%8e%d1%87%d0%b8%d1%82%d1%8c-%d0%b0%d0%b2%d1%82%d0%be%d0%bc%d0%b0%d1%82%d0%b8%d1%87%d0%b5%d1%81%d0%ba%d0%be%d0%b5-%d1%84%d0%be%d1%80/#post-171411)
 * Заменила, и стали выводится только превью записи и читать далее, а сам текст 
   пропал
 *  [Flector](https://ru.wordpress.org/support/users/flector/)
 * (@flector)
 * [11 лет, 5 месяцев назад](https://ru.wordpress.org/support/topic/%d0%bd%d0%b5-%d0%bc%d0%be%d0%b3%d1%83-%d0%be%d1%82%d0%ba%d0%bb%d1%8e%d1%87%d0%b8%d1%82%d1%8c-%d0%b0%d0%b2%d1%82%d0%be%d0%bc%d0%b0%d1%82%d0%b8%d1%87%d0%b5%d1%81%d0%ba%d0%be%d0%b5-%d1%84%d0%be%d1%80/#post-171503)
 *     ```
       if (!function_exists('g7_entry_content')) {
           function g7_entry_content() {
               $content_type   = g7_meta('blog_content', 1);
               $excerpt_length = g7_meta('blog_excerpt', 60);
               $content = get_post_field('post_content', get_the_ID());
               $content_parts = get_extended($content);
               $content        = '';
               if ($post_content) {
                   $content = '<div class="entry-content">' . $content_parts['main'] . '</div>';
               }
               if (is_single()) {
                   $content .= $content_parts['extended']; }
               return $content;
           }
       }
       ```
   
 * так попробуйте.
    вообще, в таких случаях вам надо дать ссылку на тему и объяснить,
   что и где вы хотите получить. а то сложно со стороны сказать, как надо сделать—
   я вот понятия не имею, где у вас g7_entry_content используется. если на страницах
   одиночных записей — то полный текст записи пропадет — на этот случай я проверку
   вставил.
 *  Автор [phnataly](https://ru.wordpress.org/support/users/phnataly/)
 * (@phnataly)
 * [11 лет, 5 месяцев назад](https://ru.wordpress.org/support/topic/%d0%bd%d0%b5-%d0%bc%d0%be%d0%b3%d1%83-%d0%be%d1%82%d0%ba%d0%bb%d1%8e%d1%87%d0%b8%d1%82%d1%8c-%d0%b0%d0%b2%d1%82%d0%be%d0%bc%d0%b0%d1%82%d0%b8%d1%87%d0%b5%d1%81%d0%ba%d0%be%d0%b5-%d1%84%d0%be%d1%80/#post-171505)
 * g7_entry_content используется в шаблоне одиночной записи (content-small.php)
   
   Тема [http://themeforest.net/item/headline-news-clean-and-modern-magazine-theme/7744030](http://themeforest.net/item/headline-news-clean-and-modern-magazine-theme/7744030)
   Дважды обращалась к автору, но он не может или не хочет помогать.
 * Код заменила — не помогло.
 *  [headonfire](https://ru.wordpress.org/support/users/headonfire/)
 * (@headonfire)
 * [11 лет, 5 месяцев назад](https://ru.wordpress.org/support/topic/%d0%bd%d0%b5-%d0%bc%d0%be%d0%b3%d1%83-%d0%be%d1%82%d0%ba%d0%bb%d1%8e%d1%87%d0%b8%d1%82%d1%8c-%d0%b0%d0%b2%d1%82%d0%be%d0%bc%d0%b0%d1%82%d0%b8%d1%87%d0%b5%d1%81%d0%ba%d0%be%d0%b5-%d1%84%d0%be%d1%80/#post-171510)
 * Найдите в коде где определяется функция `g7_post_content()` и покажите нам ее
   содержимое. Там должны быть хуки, через которые можно модифицировать вывод. Если
   их нет — править надо именно ту функцию. Она, вероятнее всего, вырезает html 
   перед выводом. Как только будет обнаружено место, в котором происходит это членовредительство—
   верните все как было и поправьте только эту функцию.
 *  Автор [phnataly](https://ru.wordpress.org/support/users/phnataly/)
 * (@phnataly)
 * [11 лет, 5 месяцев назад](https://ru.wordpress.org/support/topic/%d0%bd%d0%b5-%d0%bc%d0%be%d0%b3%d1%83-%d0%be%d1%82%d0%ba%d0%bb%d1%8e%d1%87%d0%b8%d1%82%d1%8c-%d0%b0%d0%b2%d1%82%d0%be%d0%bc%d0%b0%d1%82%d0%b8%d1%87%d0%b5%d1%81%d0%ba%d0%be%d0%b5-%d1%84%d0%be%d1%80/#post-171516)
 * нашла
 *     ```
       /**
        * get post content
        * @param  string $type        excerpt or full content
        * @param  int $excerpt_length number of words for excerpt
        * @return string
        */
       if (!function_exists('g7_post_content')) {
       	function g7_post_content($type, $excerpt_length) {
       		switch ($type) {
       			case '1':
       				$length = (int)$excerpt_length;
       				$length = $length == 0 ? 20 : $length;
       				$post_content = wp_trim_words(get_the_excerpt(), $length);
       				break;
       			case '2':
       				$post_content = get_the_content();
       				$post_content = apply_filters('the_content', $post_content);
       				$post_content = str_replace(']]>', ']]>', $post_content);
       				break;
       			default:
       				$post_content = '';
       				break;
       		}
       		return $post_content;
       	}
       }
       ```
   
 * и нашла так же функцию excerpt
 *     ```
       /**
        * custom excerpt more
        */
       if (!function_exists('g7_excerpt_more')) {
       	function g7_excerpt_more($more) {
       		return '';
       	}
       	add_filter('excerpt_more', 'g7_excerpt_more');
       }
   
       /**
        * custom excerpt length
        */
       if (!function_exists('g7_excerpt_length')) {
       	function g7_excerpt_length($length) {
       		return 100;
       	}
       	add_filter('excerpt_length', 'g7_excerpt_length');
       }
       ```
   
 *  [headonfire](https://ru.wordpress.org/support/users/headonfire/)
 * (@headonfire)
 * [11 лет, 5 месяцев назад](https://ru.wordpress.org/support/topic/%d0%bd%d0%b5-%d0%bc%d0%be%d0%b3%d1%83-%d0%be%d1%82%d0%ba%d0%bb%d1%8e%d1%87%d0%b8%d1%82%d1%8c-%d0%b0%d0%b2%d1%82%d0%be%d0%bc%d0%b0%d1%82%d0%b8%d1%87%d0%b5%d1%81%d0%ba%d0%be%d0%b5-%d1%84%d0%be%d1%80/#post-171517)
 * В первой функции есть строчка:
 * `$post_content = str_replace(']]>', ']]>', $post_content);`
 * Похоже, она и вырезает все шорткоды и теги. Уберите оттуда угловые скобки и посмотрите,
   что будет.
 *  Автор [phnataly](https://ru.wordpress.org/support/users/phnataly/)
 * (@phnataly)
 * [11 лет, 5 месяцев назад](https://ru.wordpress.org/support/topic/%d0%bd%d0%b5-%d0%bc%d0%be%d0%b3%d1%83-%d0%be%d1%82%d0%ba%d0%bb%d1%8e%d1%87%d0%b8%d1%82%d1%8c-%d0%b0%d0%b2%d1%82%d0%be%d0%bc%d0%b0%d1%82%d0%b8%d1%87%d0%b5%d1%81%d0%ba%d0%be%d0%b5-%d1%84%d0%be%d1%80/#post-171520)
 * не помогло (
 *  [headonfire](https://ru.wordpress.org/support/users/headonfire/)
 * (@headonfire)
 * [11 лет, 5 месяцев назад](https://ru.wordpress.org/support/topic/%d0%bd%d0%b5-%d0%bc%d0%be%d0%b3%d1%83-%d0%be%d1%82%d0%ba%d0%bb%d1%8e%d1%87%d0%b8%d1%82%d1%8c-%d0%b0%d0%b2%d1%82%d0%be%d0%bc%d0%b0%d1%82%d0%b8%d1%87%d0%b5%d1%81%d0%ba%d0%be%d0%b5-%d1%84%d0%be%d1%80/#post-171568)
 * Значит надо смотреть в сторону строчки, которая сразу над ней:
 * `$post_content = apply_filters('the_content', $post_content);`
 * Здесь применяются на лету фильтры для the_content (контента из визуального редактора).
   WordPress применяет ряд стандартных фильтров, но, вполне возможно, что ваша тема
   хукается в этот фильтр и применяет свой, вырезающий теги. Вам в файлах вашей 
   темы надо найти подобную конструкцию:
 *     ```
       function some_function_name() {
           ...
       }
       add_filter( 'the_content', 'some_function_name' );
       ```
   
 * где `some_function_name` будет какая-то функция темы, вероятнее всего с префиксом`
   g7_`. Возможно, определение функции и строчка `add_filter()` будут в обратном
   порядке (сверху фильтр, под ним функция).
 *  Автор [phnataly](https://ru.wordpress.org/support/users/phnataly/)
 * (@phnataly)
 * [11 лет, 5 месяцев назад](https://ru.wordpress.org/support/topic/%d0%bd%d0%b5-%d0%bc%d0%be%d0%b3%d1%83-%d0%be%d1%82%d0%ba%d0%bb%d1%8e%d1%87%d0%b8%d1%82%d1%8c-%d0%b0%d0%b2%d1%82%d0%be%d0%bc%d0%b0%d1%82%d0%b8%d1%87%d0%b5%d1%81%d0%ba%d0%be%d0%b5-%d1%84%d0%be%d1%80/#post-171608)
 * Нашла: add_filter(‘the_content’, ‘g7_add_review’);
    полная функция:
 *     ```
       if (!function_exists('g7_add_review')) {
       	function g7_add_review($content) {
       		if (!is_single()) {
       			return $content;
       		}
       		$post_id  = get_the_ID();
       		$review_post = get_post_meta($post_id, '_g7_review_post', true);
       		if (!$review_post) {
       			return $content;
       		}
   
       		$criteria     = get_post_meta($post_id, '_g7_criteria', true);
       		$rating       = get_post_meta($post_id, '_g7_rating', true);
       		$overall      = get_post_meta($post_id, '_g7_overall_rating', true);
       		$overall_text = get_post_meta($post_id, '_g7_overall_text', true);
       		$summary      = get_post_meta($post_id, '_g7_summary', true);
       		$style        = get_post_meta($post_id, '_g7_rating_style', true);
       		$position     = get_post_meta($post_id, '_g7_review_position', true);
       		$category     = get_the_category();
       		$cat_name     = $category[0]->cat_name;
   
       		switch ($style) {
       			default:
       			case 1:
       				$class = 'review-star';
       				$ratingValue = $overall / 20;
       				$ratingValue = number_format($ratingValue, 1);
       				$bestRating = 5;
       				break;
       			case 2:
       				$class = 'review-number';
       				$ratingValue = $overall / 10;
       				$ratingValue = number_format($ratingValue, 1);
       				$bestRating = 10;
       				break;
       			case 3:
       				$class = 'review-percent';
       				$ratingValue = $overall;
       				$bestRating = 100;
       				break;
       		}
       		switch ($position) {
       			default:
       			case 1: $class2 = ' review-top'; break;
       			case 2: $class2 = ' review-bottom'; break;
       		}
   
       		$review = '<div class="review ' . $class . $class2 . '">';
       		$review .= '<h2>' . __('Review', 'g7theme') . '</h2>';
       		foreach ((array)$rating as $k => $v) {
       			$review .= '<div class="review-item">';
       			$review .= $criteria[$k];
       			$review .= '<div class="score">';
       			$review .= g7_rating($v, $style);
       			$review .= '</div>';
       			if ($style > 1) {
       				$review .= '<div class="bar"><div style="width:' . $v . '%"></div></div>';
       			}
       			$review .= '</div>';
       		}
       		$review .= '<div class="review-footer">';
       		$review .= '<div class="review-overall">';
       		$review .= g7_rating($overall, $style);
       		if ($overall_text) {
       			$review .= '<h4>' . $overall_text . '</h4>';
       		}
       		$review .= '</div>';
       		$review .= '<div class="review-summary" itemprop="description">';
       		$review .= $summary;
       		$review .= '</div>';
       		$review .= '</div>';
       		$review .= '<meta itemprop="itemReviewed" content="' . esc_attr($cat_name) . '">';
       		$review .= '<div itemtype="http://schema.org/Rating" itemscope itemprop="reviewRating">';
       		$review .= '<meta content="0" itemprop="worstRating">';
       		$review .= '<meta content="' . $ratingValue . '" itemprop="ratingValue">';
       		$review .= '<meta content="' . $bestRating . '" itemprop="bestRating">';
       		$review .= '</div>';
       		$review .= '</div>';
   
       		if ($position == 2) {
       			return $content . $review;
       		} else {
       			return $review . $content;
       		}
       	}
       	add_filter('the_content', 'g7_add_review');
       }
       ```
   
 *  [headonfire](https://ru.wordpress.org/support/users/headonfire/)
 * (@headonfire)
 * [11 лет, 5 месяцев назад](https://ru.wordpress.org/support/topic/%d0%bd%d0%b5-%d0%bc%d0%be%d0%b3%d1%83-%d0%be%d1%82%d0%ba%d0%bb%d1%8e%d1%87%d0%b8%d1%82%d1%8c-%d0%b0%d0%b2%d1%82%d0%be%d0%bc%d0%b0%d1%82%d0%b8%d1%87%d0%b5%d1%81%d0%ba%d0%be%d0%b5-%d1%84%d0%be%d1%80/#post-171664)
 * В этом место к `the_content()` только добавляется review, сам контент не модифицируется.
   Ищите дальше. Просто так из контента не могут вырезаться теги, где-то точно есть
   фрагмент кода, который это делает.
 * Разве что я неправильно понял задачу. Сейчас выпью кофе и перечитаю заново 🙂

Просмотр 11 ответов — с 1 по 11 (всего 11)

 Тема «Не могу отключить автоматическое форматирование» закрыта для новых ответов.

## Метки

 * [автоматическое форматировани](https://ru.wordpress.org/support/topic-tag/%d0%b0%d0%b2%d1%82%d0%be%d0%bc%d0%b0%d1%82%d0%b8%d1%87%d0%b5%d1%81%d0%ba%d0%be%d0%b5-%d1%84%d0%be%d1%80%d0%bc%d0%b0%d1%82%d0%b8%d1%80%d0%be%d0%b2%d0%b0%d0%bd%d0%b8/)

 * Форум: [Темы и шаблоны](https://ru.wordpress.org/support/forum/themes-and-templates/)
 * 11 ответов
 * 3 участника
 * Последний ответ: [headonfire](https://ru.wordpress.org/support/users/headonfire/)
 * Последняя активность: [11 лет, 5 месяцев назад](https://ru.wordpress.org/support/topic/%d0%bd%d0%b5-%d0%bc%d0%be%d0%b3%d1%83-%d0%be%d1%82%d0%ba%d0%bb%d1%8e%d1%87%d0%b8%d1%82%d1%8c-%d0%b0%d0%b2%d1%82%d0%be%d0%bc%d0%b0%d1%82%d0%b8%d1%87%d0%b5%d1%81%d0%ba%d0%be%d0%b5-%d1%84%d0%be%d1%80/#post-171664)
 * Статус: решённая

## Темы

### Самые популярные темы

### Темы без ответов

### Без вопроса

### Решённые

### Нерешённые

### Все темы
