This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter( 'wpseo_json_ld_output', '__return_false' ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter( | |
'render_block', | |
function ( $block_content, $block ) { | |
if ( 'core/image' === $block['blockName'] ) { | |
$block_content = str_replace( | |
array( '<figure ', '</figure>' ), | |
array( '<p ', '</p>' ), | |
$block_content | |
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Меняем дату создания записи на дату её обновления | |
* в плагине The SEO Framework на страницах записей. | |
* | |
* @param string $time Время создания записи. | |
* @param int $post_id Идентификатор записи. | |
*/ | |
add_filter( | |
'the_seo_framework_publishedtime_output', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Делаем alt для Превью поста. Функция автозаполнения alt должна быть отключена в плагинах типа | |
* Webcraftic Clearfy или любом другом, который устанавливает alt автоматически, | |
* так как там всегда генерирует на основе заголовка. | |
* В некоторых темах, например OceanWP alt прописан как заголовок статьи в самой теме, | |
* и там нужно дополнительно кодить. В Astra всё нормально работает | |
* | |
* @param array $attr Массив дефолтных атрибутов картинки. | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Convert time for scheme. | |
* | |
* @param int $seconds Time in seconds. | |
* | |
* @return string | |
*/ | |
function convert_time_to_scheme( $seconds ) { | |
$days = floor( $seconds / DAY_IN_SECONDS ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Добавляем свой шрифт в тему асинхронно | |
* | |
* @link https://github.com/typekit/webfontloader | |
*/ | |
function mihdan_add_roboto_font() { | |
?> | |
<script type="text/javascript"> | |
WebFontConfig = { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script> | |
(function($) { | |
$(function() { | |
var data = { | |
'facets': { | |
'make': ['audi'], | |
'vehicle_type': [] | |
}, | |
'query_args': { | |
'post_type': 'cars', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
use Yoast\WP\SEO\Presenters\Abstract_Indexable_Tag_Presenter; | |
/** | |
* Debug microdata. | |
*/ | |
add_filter( 'yoast_seo_development_mode', '__return_true' ); | |
/** | |
* Change datePublished to dateModified in microdata |