E
E
Elizaveta Cezurk2020-06-01 17:48:00
WordPress
Elizaveta Cezurk, 2020-06-01 17:48:00

Why can't compare data?

Good evening, another problem.
I enter the page title into a variable, don't ask why.

$test_name = wp_title('',FALSE);
$str1 = 'уццу';
if ( $test_name == $str1 ){
  echo "Всё работает";
}else{
  echo "Ничего не работает..";
}

and trying to compare with another variable with identical text.
But, nothing comes out ...
What is the reason and where is my mistake?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
P
Pashenka, 2020-06-01
@semechki

wp_title

This feature has been deprecated since WordPress 4.4.
Get the title the_title()or get_the_title()(this one is suitable for writing to a variable).

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question