Skip to content

Instantly share code, notes, and snippets.

@artikus11
Last active January 11, 2022 09:02
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save artikus11/2fa470ba0f71c03761b81dde3ea3f6a7 to your computer and use it in GitHub Desktop.
Save artikus11/2fa470ba0f71c03761b81dde3ea3f6a7 to your computer and use it in GitHub Desktop.
Добавление собственных фраз перед заголовком товара, на странице товара
remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_title', 5 ); //отключаем шататный вывод заголовка
add_action( 'woocommerce_single_product_summary', 'art_before_title_product', 5 ); //Подключаем собственную функцию вывода заголовка
function art_before_title_product() {
if (is_product){ // проверяем что это страница отдельного товара
the_title( '<h1 class="product_title entry-title">Фотообои ', '</h1>', true ); // выводим заголовк в собственной обертке
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment