[Resolved] Page header addon – unable to create page header for blog page

Home Forums Support [Resolved] Page header addon – unable to create page header for blog page

Home Forums Support Page header addon – unable to create page header for blog page

  • This topic has 5 replies, 3 voices, and was last updated 7 years ago by Tom.
Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #305592
    Janek

    Hi,
    Just to be clear: is it possible to make a page header for Blog page or is id deactivated since it is set on WP settings?

    At the moment i added image, text etc but no page header is shown.

    Thanks,
    J.

    PS! How can i make a Login/Logout button as you have on top right here? ๐Ÿ˜‰

    #305620
    Leo
    Staff
    Customer Support

    Hi Janek,

    The page header add-on for the blog page is actually in the customizer as WordPress ignores all metabox on index pages: https://docs.generatepress.com/article/blog-page-header/

    As for the button, here are the CSS you will need:

    .button.see-through {
        background-color: transparent;
        color: #222
        font-weight: 700;
        border: 2px solid #2A3949;
    }
    .button, .button:visited {
        display: inline-block;
        padding: 10px 15px;
        font-size: 17px;
        margin-bottom: 5px;
    }
    .login-button.button.see-through {
        background: #FFF;
        margin: 0;
        width: 100%;
        -moz-box-sizing: border-box;
        -webkit-box-sizing: border-box;
        box-sizing: border-box;
        text-align: center;
    }

    Make sure that you include these three classes: button see-through login-button

    More info on buttons here: https://docs.generatepress.com/article/adding-buttons/

    Let me know.

    #305624
    Janek

    Hi,
    Thank you for your quick reply.

    Do you have two button up there which show up regardin whether i am logged in. Or is there a function which shows either Login button (with Login text) or Logout button with text?

    #305699
    Tom
    Lead Developer
    Lead Developer

    It’s actually a shortcode which outputs the appropriate button:

    add_shortcode( 'gp_login', 'gp_login' );
    function gp_login() {
    	if ( ! is_user_logged_in() ) {
    		return '<a class="button login-button" href="' . esc_url( wp_login_url( get_permalink() ) ) . '">Login</a>';
    	} else {
    		return '<a class="button login-button" href="' . esc_url( wp_logout_url( get_permalink() ) ) . '">Logout</a>';
    	}
    }
    #305831
    Janek

    Great, thanks

    #305965
    Tom
    Lead Developer
    Lead Developer

    No problem ๐Ÿ™‚

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.