Support » Theme: OceanWP » Disable Header on Specific Page

  • Jethro Burnett Thorburn

    (@happyhealthyhonesthuman)


    Good Day,

    On one of the pages on my website is a Dashboard that sellers use to manage their products.

    At the moment, the Header of my website is causing errors on this page.

    Is there a simple way to disable the header completely on a specific URL? Would that be possible?

    Kind regards,
    Jethro

    The page I need help with: [log in to see the link]

Viewing 10 replies - 1 through 10 (of 10 total)
  • Hello,

    TO disable the header for a page/post, edit the post/page > oceanwp settings > header tab and select disable.

    If it is a dynamic page, please share the link. I’ll give the correct code to do it.

    Thread Starter Jethro Burnett Thorburn

    (@happyhealthyhonesthuman)

    Hi Amit,

    Thank you for the assistance.

    Unfortunately I have already tried disabling the Header viable the OceanWP Settings when I Edit the Page and it did not have any results.

    Furthermore, I also tried to use a plugin called Asset CleanUp: Page Speed Booster which enables the admin to unload CSS, JS, and other code on a specific page. I used this plugin to disable all OceanWP code on this page, and there is still the issue visible.

    Please see the screenshots at this URL to see the problem: https://imgur.com/a/yORfx5F

    The problem is that at the bottom of the Dashboard there are images and text relating to the Woocommerce Cart button which is part of the OceanWP header.

    I am not sure why it is there or like that, but it just looks unprofessional and ideally I would like to just not use ANY header code on this page.

    I have also tried using the aforementioned plugin to disable some of the Woocommerce code to see whether that would do away with the Cart information but it didn’t help either…

    Thank you for your help Amit.

    Kind regards,
    Jethro

    Have you shared the correct screenshot? Because I didn’t see anything on your site as you mentioned in the image even the layout. They are totally different. Can you link to the page where you have the issue?

    For the broken cart, try to disable/enable plugin one by one to check for a possible conflict.

    Thread Starter Jethro Burnett Thorburn

    (@happyhealthyhonesthuman)

    The page where I am experiencing the issue is a page only accessible by a certain User Role on the website and it is called the Dashboard. The User Role is “Vendor” and they use the Dashboard to manage their products which they sell on my website.

    The URL is https://molomarket.com/dashboard

    The page visible in the screenshots I shared is the Dashboard.

    Even if you do not log into the Dashboard, you can still see below the login area that it says “Basket”. On my website I have changed the text from “Cart” to “Basket”. Now because your Basket is empty you will not see any products, just the title. However, if you were to add products to your Basket and then go to that URL you will see that there is a glitch there, and the glitch is also visible if a user actually proceeds to log into the Dashboard (and that is what is seen in screenshots 2 and 3 that I shared earlier).

    If you, for example, go to the shop URL (https://molomarket.com/the-market), add a few products to your Basket/Cart, and then go to the Dashboard URL (https://molomarket.com/dashbaord), you will see the glitch I am referring to.

    In the 2nd and 3rd screenshots one can see that there are images of a yellow person with a question mark and an orange/yellow block. Those are in fact Test Products within my product archive which the user has in their cart/basket.

    Then on this specific page, there is a glitch and you can see those images and details at the bottom of the Dashboard. Further to the left of the square images you can also see some details which are the product price, title, and other details, but they are slightly cut off and one cannot see them completely.

    I am trying to disable all Header functionality on the Dashboard page because there is no need for the Header at all (and it is causing this layout error).

    Please let me know if you need any further explanation, more screenshots, or user access to get a better image of what exactly I am referring to.

    I’m not able to view the page. It is displaying page not found error. Try to add the below code to the oceanwp child theme’s functions.php file to disable header from a page. This code is for search page. Edit the condition and make it as per your need –

    function disable_site_header( $return ) {
        if ( is_search() ) {
            $return = false;
        }
        return $return;
    }
    add_filter( 'ocean_display_header', 'disable_site_header' );
    Thread Starter Jethro Burnett Thorburn

    (@happyhealthyhonesthuman)

    Hey Amit,

    Thank you for the assistance.

    My apologies, I supplied an incorrect URL for the shop.

    It is: https://molomarket.com/market

    —————————————————

    The thing is that on the Dashboard page, it is not the entire Header that appears. It is only the OceanWP Cart button and information. I changed the text “cart” to “basket” on my entire website.

    If you go to https://molomarket.com/dashboard you will see beneath the login box there is text that says “Basket” with an “x” next to it.

    If you go to the correct shop URL and then add some products to the Basket and then go back to the Dashboard URL you will see the full extent of the glitch.

    ————————————-

    Nevertheless, I have tried to modify the code you generously supplied me with:

    I tried to use the PostID.

    The postID for the Dashboard is 11539;

    So I have tried to use the postID to disable the header on that page. However, the Basket element of the header is still displayed there.

    I have no training in PHP but I am trying to learn.

    Any ideas why the below code might not be working Amit?

    function disable_site_header($return) {
    if ($wp_query->post->ID == 11539) {
    $return = false;
    }
    return $return;
    }
    add_filter( ‘ocean_display_header’, ‘disable_site_header’ );

    Sorry, but I still didn’t see the issue on your site. The header is not causing the issue. Try to disable all the plugin except ocean extra + woocommerce and check it works or not. If it works, then enable other plugins one by one to check which plugin is causing this issue.

    Thread Starter Jethro Burnett Thorburn

    (@happyhealthyhonesthuman)

    Hi Amit,

    I have just taken a new screenshot: https://imgur.com/RGawuLK

    Are you saying that you cannot see the stuff within the red square in this screenshot when you access https://molomarket.com/dashboard ?

    You are using Elementor Canvas which may be a possible reason because it removes some code that is necessary. Try using default or 100% full-width template and check it works or not. To disable header and footer, you can use page-level oceanwp settings.
    Also, go to Theme Panel > Scripts & Style, disable all – save settings, then enable it again. Clear cache and check it works or not.

    Thread Starter Jethro Burnett Thorburn

    (@happyhealthyhonesthuman)

    Hi Amit,

    Thank you for the suggestions.

    I have tried switching to the Default Template. It didn’t change anything.

    I have used the page level OceanWP settings. It didn’t change anything.

    I have tried the Scripts & Styles solution. It didn’t change anything.

    Here is what progress I have made:

    I have now Enabled the Header on the Dashboard page (https://molomarket/dashboard).

    If you can look there, you will see that the header is above the Login box, and then below the Login box is the stuff I am having a problem with removing.

    So to me it seems that the stuff I am trying to remove is not directly related to the Header. I can remove the Header, but the “Close Menu Here” and the “Basket” and “No products in the basket” still remains when I remove the Header.

    I think it may be related to the AJAX WooCommerce Cart Menu that drops down from the main menu.

    I tried disabling all WooCommerce scripts on this page using Asset CleanUp: Page Speed Booster and I also disabled OceanExtra, but that stuff is still there.

    I don’t know whether it could be removed using some code?

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Disable Header on Specific Page’ is closed to new replies.