• Resolved charique

    (@charique)


    I’m working on a site for a client and I need to customize the password page. Right now, I have the form and password button but I need to remove the nav panel and footer.

    I tried several CSS codes to remove them but I’m hitting a brick wall. Help is greatly appreciated!

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

Viewing 9 replies - 1 through 9 (of 9 total)
  • Theme Author oceanwp

    (@oceanwp)

    Hello, you want to remove everything except the password form, that’s right?

    Thread Starter charique

    (@charique)

    Yes, and add a background image.

    Hi Charique,

    You can try adding the following code to your Admin Panel > Appearance > Customize > Additional CSS field:

    header#site-header, footer {
      display: none;
    }

    Thanks!

    Thread Starter charique

    (@charique)

    Thanks! I’ll try that. Will it remove it from the whole site or just the password page?

    Theme Author oceanwp

    (@oceanwp)

    Hello, add this code in the functions.php file of your child theme:

    function prefix_password_protected( $return ) {
    
    	if ( post_password_required() ) {
    		$return = false;
    	}
    
    	// Return
    	return $return;
    
    }
    add_filter( 'ocean_display_top_bar', 'prefix_password_protected' );
    add_filter( 'ocean_display_header', 'prefix_password_protected' );
    add_filter( 'ocean_display_page_header', 'prefix_password_protected' );
    add_filter( 'ocean_display_footer_widgets', 'prefix_password_protected' );
    add_filter( 'ocean_display_footer_bottom', 'prefix_password_protected' );
    Thread Starter charique

    (@charique)

    Thanks!

    Theme Author oceanwp

    (@oceanwp)

    You’re welcome ??

    Thread Starter charique

    (@charique)

    That worked!

    I downloaded the child theme, imported my settings, and the page is now blank except for the form. I also need to put a placeholder background image on this page until my client gives me the actual image for the page.

    I uploaded the placeholder image in the media library. What code can I use for this? The one I tried didn’t work.

    Thanks

    Theme Author oceanwp

    (@oceanwp)

    Hi, first, add this code in your functions.php file:

    function prefix_password_protected_class( $classes ) {
    
    	if ( post_password_required() ) {
    		$classes[] = 'password-protected';
    	}
    
    	// Return
    	return $classes;
    
    }
    add_filter( 'body_class', 'prefix_password_protected_class' );

    Then add this css code:

    body.password-protected {
        background-image: url(IMAGE_URL);
    }
    • This reply was modified 6 years, 9 months ago by oceanwp.
Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Need to Remove Footer & Nav Menu’ is closed to new replies.