Archived topic
Page header addon - unable to create page header for blog page
5 replies · Started by Janek on April 13, 2017
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? ;)
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.
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?
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>';
}
}
Great, thanks
No problem :)