A
A
Al Sm2016-04-16 11:17:28
PHP
Al Sm, 2016-04-16 11:17:28

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 } ?>

Many thanks to all who responded!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Al Sm, 2016-04-16
@radio_mus

The problem was due to one closing tag

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question