add_filter( 'register_post_type_args', 'filter_function_name_8795', 10, 2 );
function filter_function_name_8795( $args, $post_type ){
$locale_position = get_locale();
if ( 'post' == $post_type && $locale_position == 'en_US' ) {
$args['labels'] = [
'name' => __( 'Article', 'mydomain' )
];
} elseif ( 'post' == $post_type && $locale_position == 'ru_RU' ) {
$args['labels'] = [
'name' => __( 'Статьи', 'mydomain' )
];
}
return $args;
}
function my_custom_body_class_slug($classes) {
if ( is_page( '3' ) ) {
$classes[] = 'services';
}
if ( is_page( '12' ) ) {
$classes[] = 'projects';
}
if ( is_page( '15' ) ) {
$classes[] = 'about';
}
if ( is_page( '18' ) ) {
$classes[] = 'contact';
}
return $classes;
}
add_filter('body_class','my_custom_body_class_slug');
<body <?php body_class($classes); ?>>
function my_custom_body_class_slug($classes) {
if ( is_page( 'page-about' ) ) {
$classes[] = 'about';
}
if ( is_page( 'page-contact' ) ) {
$classes[] = 'contact';
}
return $classes;
}
add_filter('body_class','my_custom_body_class_slug');
<a id="phone" href=""></a>
document.addEventListener('DOMContentLoaded', () => {
const link = document.querySelector('#phone');
let activeIndex = 0;
const numbers = ['(098) 02 56 888', '(099) 02 56 888', '(093) 02 56 888'];
setNumber(numbers[activeIndex]);
setInterval(() => {
setNumber(numbers[activeIndex]);
activeIndex = (activeIndex + 1) % numbers.length;
}, 2000);
function setNumber(number) {
link.innerText = number;
link.setAttribute('href', 'tel:+38' + number);
}
});