Hide footer in certain pages

Hi,

I’d like to hide the footer on just certain pages.

I didn’t find any page id to hide it in function.php with code like that :

add_action('wp_footer', 'hide_footer');

function hide_footer() {
    if (is_page('page-id')) {
        ?>
        <style>
            .site-footer {
                display: none;
            }
        </style>
        <?php
    }
}

I tried with the slug of the page and it doesn’t work.

Any help on that ? :slight_smile:

Hi,

Unfortunately, this is not a HivePress-specific setting, so we can’t provide more details. But the snippet looks good, I recommend adding the !important parameter and everything should work correctly.

Hi,

I found a better and easier solution.

Hide a specific footer’s page in CSS, here in submit listing page :

.hp-template--listing-submit-page .site-footer {
    display: none;
}

I used the page class displayed in the <body, found with the inspect tool.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.