Answer the question
In order to leave comments, you need to log in
Why is the is_page() function not working?
Hello.
For different output of some content on pages, there is different code in header.php , but the is_page () function does not want to work out in any way. I tried to identify the page by id , and by title , and by slug , but it doesn't work.
By the way, in the same header.php , a similar code works in the is_front_page() and is_post_type_archive() functions , but is_page() does not want to. Tell me please, what could be the snag?
Code example:
<?php
wp_reset_query();
if ( is_page('kalk') ) {
?>
<div class="block">
<div class="title">
<div class="top">Кальулятор</div>
</div>
</div>
<?php } ?>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question