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('acf/format_value/type=text', 'do_shortcode'); |
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
// HTML | |
<div class="spawnElement"> | |
<div class="overflow"></div> | |
<span class="play_video"> | |
<svg width="83" height="59" viewBox="0 0 83 59" fill="none" xmlns="http://www.w3.org/2000/svg"> | |
<path d="M81.1683 9.32124C80.6922 7.56574 79.7635 5.96531 78.4748 4.67932C77.186 3.39333 75.582 2.46664 73.8227 1.99153C67.3816 0.23877 41.4586 0.23877 41.4586 0.23877C41.4586 0.23877 15.5343 0.291825 9.09326 2.04459C7.33385 2.51972 5.72989 3.44646 4.4411 4.73251C3.15231 6.01857 2.22366 7.61906 1.74763 9.37461C-0.200632 20.7938 -0.956399 38.1939 1.80113 49.1563C2.27721 50.9118 3.20588 52.5122 4.49467 53.7982C5.78345 55.0842 7.38739 56.0109 9.14675 56.486C15.5878 58.2388 41.5115 58.2388 41.5115 58.2388C41.5115 58.2388 67.4348 58.2388 73.8755 56.486C75.6349 56.0109 77.239 55.0843 78.5278 53.7983C79.8166 52.5123 80.7454 50.9118 81.2215 49.1563C83.2764 37.721 83.9096 20.3315 81.1683 9.32124Z" fill="#FF0000"/> | |
<path d="M33.2074 41.6671L54.7126 29.2386L33.2074 16.8101V41.6671Z" fill="white"/> | |
</s |
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
// ---- Добавить в functions.php темы | |
function cg_revert_jquery_version_admin() { | |
wp_deregister_script( 'jquery' ); | |
wp_register_script( 'jquery', 'https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js'); | |
wp_enqueue_script( 'jquery' ); | |
} | |
add_action( 'admin_enqueue_scripts', 'cg_revert_jquery_version_admin' ); |
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
// Добавляем в functions.php шаблона | |
// Открываем FancyBox 3 после отправки сообщений | |
add_action( 'wp_footer', 'mycustom_wp_footer' ); | |
function mycustom_wp_footer() { | |
?> | |
<script type="text/javascript"> | |
jQuery(document).ready(function($){ | |
document.addEventListener( 'wpcf7mailsent', function( event ) { | |
$.fancybox.open('<div class="popup ok-send animated-modal"><h2>Сообщение отправлено!</h2><p>Спасибо за Ваше сообщение. Оно успешно отправлено!</p></div>'); |
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
/*ACF taxonomy parent*/ | |
// category ancestor location rule | |
add_filter('acf/location/rule_types', 'acf_location_types_category_ancestor'); | |
function acf_location_types_category_ancestor($choices) | |
{ | |
if (!isset($choices['Post']['post_category_ancestor'])) { | |
$choices['Post']['post_category_ancestor'] = 'Post Category Ancestor'; | |
} | |
return $choices; | |
} |
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
//To display an image using ACF, one would set the image custom field to image url and call the img as follows: | |
<?php if( get_field( 'field_name' ) ): ?> | |
<?php while( has_sub_field( 'field_name' ) ): ?> | |
<img src="<?php the_sub_field( 'image' ); ?>" alt=""> | |
<?php endwhile; ?> |
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
//В файл functions.php добавить | |
if( function_exists('acf_add_options_page') ) { | |
acf_add_options_page(); | |
} |
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 if(get_field('slider')): ?> | |
<?php while(has_sub_field('slider')) : ?> | |
<?php the_sub_field('slide_html'); ?> | |
<?php endwhile; ?> | |
<?php endif; ?> |
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
//ACF Radio options | |
<?php $value = get_field('view_block'); if (($value) == 'yes') : ?> | |
... | |
<?php endif; ?> | |
<?php $value = get_field('view_block'); if (($value) == 'no') : ?> | |
... | |
<?php endif; ?> | |
<?php echo get_field('tab_01_image'); ?> |