@Alex_mersvg

Как исправить ошибку на wordpress?

Не корректно открываються публикации которые создаешь. Включил дебаг, и он выдал что то не ведомое мне, прошу помочь:
Fatal error: Uncaught Error: Call to undefined function dovzhenko_underscore_posted_on() in /home/o/ozerovwebm/profit/public_html/wp-content/themes/Dovzhenko_under/template-parts/content.php:25 Stack trace: #0 /home/o/ozerovwebm/profit/public_html/wp-includes/template.php(724): require() #1 /home/o/ozerovwebm/profit/public_html/wp-includes/template.php(671): load_template('/home/o/ozerovw...', false) #2 /home/o/ozerovwebm/profit/public_html/wp-includes/general-template.php(168): locate_template(Array, true, false) #3 /home/o/ozerovwebm/profit/public_html/wp-content/themes/Dovzhenko_under/archive.php(35): get_template_part('template-parts/...', 'post') #4 /home/o/ozerovwebm/profit/public_html/wp-includes/template-loader.php(98): include('/home/o/ozerovw...') #5 /home/o/ozerovwebm/profit/public_html/wp-blog-header.php(19): require_once('/home/o/ozerovw...') #6 /home/o/ozerovwebm/profit/public_html/index.php(17): require('/home/o/ozerovw...') #7 {main} thrown in /home/o/ozerovwebm/profit/public_html/wp-content/themes/Dovzhenko_under/template-parts/content.php on line 25


И собственно сама 25 строка:
dovzhenko_underscore_posted_on();
  • Вопрос задан
  • 423 просмотра
Решения вопроса 1
vova87
@vova87
Разработка сайтов на wordpress
Так у вас же в ошибке написано все ясно. Невозможно найти функцию dovzhenko_underscore_posted_on()
Вызывается она тут /wp-content/themes/Dovzhenko_under/template-parts/content.php:25

Нужно открыть этот файл и убрать вызов несуществующей функции. Или исправить.

Исправить можно в файле /wp-content/themes/Dovzhenko_under/inc/template-tags.php Строка 14, что то типа такого:

if ( ! function_exists( 'underscore_posted_on' ) ) :
	/**
	 * Prints HTML with meta information for the current post-date/time.
	 */
	function underscore_posted_on() {
		$time_string = '<time class="entry-date published updated" datetime="%1$s">%2$s</time>';
		if ( get_the_time( 'U' ) !== get_the_modified_time( 'U' ) ) {
			$time_string = '<time class="entry-date published" datetime="%1$s">%2$s</time><time class="updated" datetime="%3$s">%4$s</time>';
		}

		$time_string = sprintf( $time_string,
			esc_attr( get_the_date( DATE_W3C ) ),
			esc_html( get_the_date() ),
			esc_attr( get_the_modified_date( DATE_W3C ) ),
			esc_html( get_the_modified_date() )
		);

		$posted_on = sprintf(
			/* translators: %s: post date. */
			esc_html_x( 'Posted on %s', 'post date', 'vchuytheme' ),
			'<a href="' . esc_url( get_permalink() ) . '" rel="bookmark">' . $time_string . '</a>'
		);

		echo '<span class="posted-on">' . $posted_on . '</span>'; // WPCS: XSS OK.

	}
endif;
Ответ написан
Комментировать
Пригласить эксперта
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Войти через центр авторизации
Похожие вопросы