This file contains hidden or 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
// catalog/controller/product/manufacturer.php | |
// start | |
if ($manufacturer_info['meta_title'] && mb_strtolower($manufacturer_info['meta_title']) != mb_strtolower($manufacturer_info['name'])) { | |
$this->document->setTitle($manufacturer_info['meta_title']); | |
} else { | |
$productTitle = $manufacturer_info['name'] . ' в Украине и Киеве купить в интернет магазине — Choco-Yummy'; | |
$this->document->setTitle($productTitle); | |
} | |
if($manufacturer_info['meta_description'] && strlen($manufacturer_info['meta_description']) > 60) { | |
$this->document->setDescription($manufacturer_info['meta_description']); |
This file contains hidden or 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 | |
$cur_cat = get_term_by('id', get_query_var('cat'), 'category'); | |
?> | |
<script type="application/ld+json"> | |
{ | |
"@context": "http://schema.org", | |
"@type": "BreadcrumbList", | |
"itemListElement": | |
[ |
This file contains hidden or 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_action('do_feed', 'itsme_disable_feed', 1); | |
add_action('do_feed_rdf', 'itsme_disable_feed', 1); | |
add_action('do_feed_rss', 'itsme_disable_feed', 1); | |
add_action('do_feed_rss2', 'itsme_disable_feed', 1); | |
add_action('do_feed_atom', 'itsme_disable_feed', 1); | |
add_action('do_feed_rss2_comments', 'itsme_disable_feed', 1); | |
add_action('do_feed_atom_comments', 'itsme_disable_feed', 1); | |
remove_action( 'wp_head', 'feed_links_extra', 3 ); | |
remove_action( 'wp_head', 'feed_links', 2 ); |
This file contains hidden or 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
add_filter( 'wpseo_canonical', 'yoast_seo_canonical_change_home_url_slash' ); | |
function yoast_seo_canonical_change_home_url_slash( $canonical_url ) { | |
$re = '/\/page\/\d+\//m'; | |
$str = $canonical_url; | |
$subst = '/'; | |
$result = preg_replace($re, $subst, $str); | |
return $result; | |
} |
This file contains hidden or 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
function setDefaultHrefImage() { | |
wp_enqueue_script( | |
'modify-image-link-destination-default', | |
get_template_directory_uri() . '/js/setDefaultHrefImage.js', | |
array('wp-hooks') | |
); | |
} | |
add_action('enqueue_block_editor_assets', 'setDefaultHrefImage'); |
This file contains hidden or 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
add_filter( 'wpcf7_form_elements', 'do_shortcode' ); | |
function pure_url_cf7_func() { | |
$submission = WPCF7_Submission::get_instance(); | |
$url = $submission->get_meta( 'url' ); | |
return strtok($url, '?'); | |
} | |
add_shortcode('puress_url', 'pure_url_cf7_func'); | |
wpcf7_add_form_tag('puress_url', 'pure_url_cf7_func'); |
This file contains hidden or 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
RewriteCond %{THE_REQUEST} \ (.*)//+ | |
RewriteRule (.*) https://www.kaper.pro/$1 [R=301,L] |
This file contains hidden or 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('request', 'rudr_change_term_request', 1, 1 ); | |
function rudr_change_term_request($query){ | |
$tax_name = 'kapers'; // specify you taxonomy name here, it can be also 'category' or 'post_tag' | |
// Request for child terms differs, we should make an additional check | |
if( isset($query['attachment']) && $query['attachment']) : |
This file contains hidden or 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
function get_flexible_loop($page_id = null){ | |
if(have_rows('flexible', $page_id)) { | |
while (have_rows('flexible', $page_id)) { | |
the_row(); | |
$section_name = str_replace('_', '-', get_row_layout()); | |
get_template_part("/parts/flexible/{$section_name}"); | |
} | |
} |
This file contains hidden or 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 | |
/** | |
* Remove the h1 tag from the WordPress editor. | |
* | |
* @param array $settings The array of editor settings | |
* @return array The modified edit settings | |
*/ | |
function remove_h1_from_editor( $settings ) { | |
$settings['block_formats'] = 'Paragraph=p;Heading 2=h2;Heading 3=h3;Heading 4=h4;Heading 5=h5;Heading 6=h6;Preformatted=pre;'; | |
return $settings; |