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 $post_type = get_post_type( $post_id ) ?> | |
<? if ($post_type == 'apartments') { echo 'Квартира'; } | |
elseif ($post_type == 'houses') { echo 'Дом'; } | |
elseif ($post_type == 'plots') { echo 'Участок'; } | |
elseif ($post_type == 'commercials') { echo 'Коммерческая недвижимость'; } | |
elseif ($post_type == 'hotels') { echo 'Гостиница'; } | |
else { echo 'Новость'; } | |
?> |
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 | |
$url = 'https://www.youtube.com/watch?v=u9-kU7gfuFA'; | |
preg_match('/[\\?\\&]v=([^\\?\\&]+)/', $url, $matches); | |
$id = $matches[1]; | |
$width = '800px'; | |
$height = '450px'; | |
?> | |
<iframe id="ytplayer" type="text/html" width="<?php echo $width ?>" height="<?php echo $height ?>" | |
src="https://www.youtube.com/embed/<?php echo $id ?>?rel=0&showinfo=0&color=white&iv_load_policy=3" | |
frameborder="0" allowfullscreen></iframe> |
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(is_archive() && ICL_LANGUAGE_CODE == 'ru'){ | |
echo '<meta name="description" content="Программы курсов по охране труда и обучению рабочим специальностям учебно-консультационного центра по охране труда «ПРОФИТЕХ»">'; | |
}?> | |
<?php if(is_archive() && ICL_LANGUAGE_CODE == 'uk'){ | |
echo '<meta name="description" content="Програми курсів з охорони праці та навчання робітничим спеціальностям навчально-консультаційного центру з охорони праці «ПРОФІТЕХ»">'; | |
}?> | |
<?php if($paged > 1 || is_author() || is_tag() || is_date() || is_attachment()){ | |
echo '<meta name="robots" content="noindex,follow" />'; | |
} ?> |
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
/** | |
* Changes the class on the custom logo in the header.php | |
*/ | |
function helpwp_custom_logo_output( $html ) { | |
$html = str_replace('custom-logo-link', 'navbar-brand', $html ); | |
return $html; | |
} | |
add_filter('get_custom_logo', 'helpwp_custom_logo_output', 10); |
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
<div class="slider-main-gallery col"> | |
<?php | |
$images = get_field('slider'); | |
if( $images ): ?> | |
<?php foreach( $images as $image ): ?> | |
<div class="slide"> | |
<span> | |
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
////ajax form, clear form on success,block btn#submit,timeout redirect | |
$(".app-form").submit(function(event){//form class | |
event.preventDefault();//stop default | |
submitForm();//send to function | |
}); | |
function submitForm(){ | |
var name = $("#name").val();//input id="name" | |
var tel = $("#tel").val();//input id="tel" | |
$.ajax({ |
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 echo esc_html__(ICL_LANGUAGE_CODE == 'ru' ? 'Тут может быть текст на русском' : 'А ось тут українською') ?> |
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 ( is_tax() ) : | |
$taxonomy = get_queried_object()->taxonomy; | |
$term_id = get_queried_object()->term_id; | |
$meta = get_option( 'wpseo_taxonomy_meta' ); | |
$title = $meta[$taxonomy][$term_id]['wpseo_title']; | |
$desc = $meta[$taxonomy][$term_id]['wpseo_desc']; | |
$focuskw = $meta[$taxonomy][$term_id]['wpseo_focuskw']; | |
//printf( '<pre>%s</pre>', print_r( get_option( 'wpseo_taxonomy_meta' ), 1 ) ); | |
// if ( isset($meta) && !empty($title) ) : |
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
<script type="text/javascript"> | |
$(function($) { | |
$("#OfficePhone").mask("(999) 999-9999? x99999"); | |
$("#InternationalOfficePhone").click(function() { | |
var mask = "(999) 999-9999? x99999"; | |
if ($("#InternationalOfficePhone").is(':checked')) { | |
$("#OfficePhone").unmask(mask); | |
} else { | |
$("#OfficePhone").mask(mask); | |
} |
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( 'field_name' ) ): ?> | |
This is displayed when the field_name is TRUE or has a value. | |
<?php else: // field_name returned false ?> | |
This is displayed when the field is FALSE, NULL or the field does not exist. | |
<?php endif; // end of if field_name logic ?> |