$lesson_id = 22; // ID категории уроки
$data = get_queried_object();
if( in_array( $lesson_id, get_ancestors( $data->term_id, $data->taxonomy ) ) ) :
echo 'Это дочерняя категория категории уроки.';
endif;
function get_category_parents( $id, $link = false, $separator = '/', $nicename = false, $visited = array() ) {
$chain = '';
$parent = get_term( $id, 'category' );
if ( is_wp_error( $parent ) )
return $parent;
if ( $nicename )
$name = $parent->slug;
else
$name = $parent->name;
if ( $parent->parent && ( $parent->parent != $parent->term_id ) && !in_array( $parent->parent, $visited ) ) {
$visited[] = $parent->parent;
$chain .= get_category_parents( $parent->parent, $link, $separator, $nicename, $visited );
}
if ( $link )
$chain .= '<a href="' . esc_url( get_category_link( $parent->term_id ) ) . '">'.$name.'</a>' . $separator;
else
$chain .= $name.$separator;
return $chain;
}
$("#btn").click(function () {
$(this).text('in progress');
console.log("--Start process--");
var hold = 500;
var elems = $(".col-xs-3");
var count = elems.length;
elems.each(function (i, t) {
var $this = $(t);
setTimeout(function () {
console.log("Start animation " + $this.text());
if ($this.hasClass("flip_effect_vertical")) {
$this.removeClass("flip_effect_vertical");
} else {
$this.addClass("flip_effect_vertical");
}
$this.on('transitionend webkitTransitionEnd oTransitionEnd', function () {
console.log("End animation " + $this.text());
});
}, i * hold);
if (i === --count) success();
});
function success() {
alert("Success");
console.log("--End process--");
$("#btn").text('start');
}
});