Дочернюю тему создать, там в functions.php добавить (заработоспособность не ручаюсь, код вбит с мобилы)
add_filter('the_content', 'my_filter_function');
function my_filter_function($content){
$content = str_replace('<figure>', '<div class="figure">', $content);
$content = str_replace('</figure>', '</div>', $content);
$out = $content;
return $out;
}
the_content();
Жалко по чему то не работает, но в синтаксисе ошибок нет, сайт работает, но изменения не на что не влияют. Общий код function.php, дочерней темы, такой:
<?php
// Exit if accessed directly
if ( !defined( 'ABSPATH' ) ) exit;
// BEGIN ENQUEUE PARENT ACTION
// AUTO GENERATED - Do not modify or remove comment markers above or below:
if ( !function_exists( 'chld_thm_cfg_locale_css' ) ):
function chld_thm_cfg_locale_css( $uri ){
if ( empty( $uri ) && is_rtl() && file_exists( get_template_directory() . '/rtl.css' ) )
$uri = get_template_directory_uri() . '/rtl.css';
return $uri;
}
endif;
add_filter( 'locale_stylesheet_uri', 'chld_thm_cfg_locale_css' );
// END ENQUEUE PARENT ACTION
add_filter('the_content', 'my_filter_function');
function my_filter_function($content){
$content = str_replace('<figure>', '<div class="figure">', $content);
$content = str_replace('</figure>', '</div>', $content);
$out = $content;
return $out;
}
the_content();
Кто ни будь, подскажите пожалуйста, в чем может быть проблемма?