Skip to content

Instantly share code, notes, and snippets.

@KaineLabs
Last active January 3, 2024 21:07
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save KaineLabs/e68fb2a7a031f7e9e4a93d40b14b0af9 to your computer and use it in GitHub Desktop.
Save KaineLabs/e68fb2a7a031f7e9e4a93d40b14b0af9 to your computer and use it in GitHub Desktop.
Enable Page Login Popup
<?php
// Enable Page Login Popup
function yzc_add_login_page_attribute( $atts, $item, $args ) {
if ( is_user_logged_in() ) {
return $atts;
}
// Get Login Page ID.
$login_page_id = 1212;
// Add Attribute.
if ( $item->ID == $login_page_id ) {
$atts['data-show-youzify-login'] = 'true';
}
return $atts;
}
add_filter( 'nav_menu_link_attributes', 'yzc_add_login_page_attribute', 999, 3 );
@cryptojasonnl
Copy link

How to add a button in my header and when they click they get this popup????

@cryptojasonnl
Copy link

Not just a link, in the navmenu But a real button with a shortcode or something but than a popup login screen

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment