U
U
user32021-01-10 15:11:08
Sublime Text
user3, 2021-01-10 15:11:08

How to insert tags in a function?

there is a file with a little less than 14k tags, they need to be inserted into the function

if ( is_tag('') ) {
    add_action( 'wp_head', 'wp_no_robots' );
  }

accordingly, for each tag to create such a design.
here is an example
if ( is_tag('psylocke-nude') ) {
    add_action( 'wp_head', 'wp_no_robots' );

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
iBird Rose, 2021-01-10
@iiiBird

most likely wp. is_tag() function https://wp-kama.ru/function/is_tag can accept an array:

is_tag( array( 30, 'metka', 'Метка' ) );
// Вернет true, когда отображается страница с постами из меток ID 30, или слаг "metka", 
// или название "Метка". Возможность указывать массив была добавлена в версии 3.7.

well, put the whole list there, separated by commas

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question