function wpdocs_scripts_method() {
$public = get_option('your_plugin_public');
wp_enqueue_script( 'custom-script', 'http://example.com/js/script-'.$public.'.js' );
}
if(get_option('your_plugin_public')) {
add_action( 'wp_enqueue_scripts', 'wpdocs_scripts_method' );
}
$categories = get_categories( array(
'orderby' => 'name',
'parent' => get_queried_object()->term_id,
'hide_empty' => false
) );
foreach ( $categories as $category ) : ?>
<a href="<?php echo get_category_link( $category->term_id ); ?>"><?php echo $category->name; ?></a>
<?php endforeach; ?>
//родительская
if(get_queried_object()->parent) {
echo get_cat_name(get_queried_object()->parent);
}
//текущая
echo get_queried_object()->name;
$cat = new WPSEO_Primary_Term('category', get_the_ID());
$cat = $cat->get_primary_term();
$catName = get_cat_name($cat);
$catLink = get_category_link($cat);
echo $catName;
echo $catLink;
add_action( 'template_redirect', 'remove_my_action' );
function remove_my_action(){
global $post;
if(get_post_meta($post->ID, 'meta_key', true) == 'значение') {
remove_action( 'cryout_branding_hook', 'tempera_title_and_description', );
}
}
<?php if ( !empty( $page_title_config['main_title'] ) ):
$class = 'a1';
if(in_category('ID_рубрики')) {
$class = 'a2';
}
?>
<h1 class="<?php echo $class; ?>">
<?php echo wp_kses( $page_title_config['main_title'], $volcanno_theme_config['allowed_html_tags'] ) ?></h1>
<?php endif; ?>
<?php if ( !empty( $page_title_config['main_title'] ) ): ?>
<h1 class="a1">
<?php if(in_category('ID_рубрики')) : ?>
<?php echo wp_kses( $page_title_config['main_title'], $volcanno_theme_config['allowed_html_tags'] ) ?>
<?php else : ?>
<?php the_title(); ?>
<?php endif; ?>
</h1>
<?php endif; ?>