Home / eCommerce / Delete Double Logo At Checkout
Duplicate Snippet

Embed Snippet on Your Site

Delete Double Logo At Checkout

Dustin Lavoie
<10
Code Preview
php
<?php
/**
 * ============================================================
 * Hide Duplicate Astra Header on Checkout
 * ============================================================
 * 
 * PURPOSE: Hides the default Astra #masthead header and the
 *          gray shadow box around the checkout page title.
 *          Spectra-built custom header remains visible.
 * 
 * INSTALL: Code Snippets plugin → "Run Everywhere"
 * ============================================================
 */
add_action( 'wp_head', 'gp_hide_duplicate_checkout_header' );
function gp_hide_duplicate_checkout_header() {
    if ( ! is_checkout() && ! is_wc_endpoint_url( 'order-pay' ) ) {
        return;
    }
    ?>
    <style id="gp-hide-duplicate-header">
        /* Hide duplicate Astra header */
        body.woocommerce-checkout #masthead {
            display: none !important;
        }
        /* Remove gray box / shadow around checkout page title */
        body.woocommerce-checkout .entry-header,
        body.woocommerce-checkout .ast-archive-description,
        body.woocommerce-checkout .woocommerce-checkout .entry-header,
        body.woocommerce-checkout .ast-page-builder-template .entry-header {
            background: transparent !important;
            box-shadow: none !important;
            border: none !important;
            padding: 0 !important;
            margin: 0 !important;
        }
        /* Also target the page title wrapper if Astra wraps it differently */
        body.woocommerce-checkout .ast-single-post-order,
        body.woocommerce-checkout .page-header,
        body.woocommerce-checkout .ast-breadcrumbs-wrapper {
            background: transparent !important;
            box-shadow: none !important;
            border: none !important;
        }
    </style>
    <?php
}

Comments

Add a Comment