• i had a child theme which did various things. Some of these are now redundant with the latest updates. However, i am wondering how to add a login/account link to the header using the new header customisation. I thought I could use the “enable_header_account” on the customiser but have realised that this only works with woocommerce. I just want the links to the standard login/logout/account pages to appear.
    the link is to the live site. I have a local test side running without the child theme.

    • This topic was modified 3 years, 1 month ago by pmoffat.

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

Viewing 6 replies - 1 through 6 (of 6 total)
  • Hi @pmoffat,

    I checked your site and seems likely you’ve been able to add some extra links to login and logout pages on top right of the header.

    Adding further, for anyone who may want to do this, you can rewrite the main theme’s header.php file to a child theme folder and make some code changes/additions in it. Or use the sydney_header hook to do the same from a custom plugin or child theme’s functions.

    Let me know if you still need any help with it or not.

    Regards,
    Kharis

    Thread Starter pmoffat

    (@pmoffat)

    Hi
    this is the live site that uses the old version of the theme and NOT the new header format.
    I’m trying to understand how i can use the latest version of the theme and new header format and add the links to login that are on the current site

    Thread Starter pmoffat

    (@pmoffat)

    any update?

    Hi @pmoffat,

    I am sorry for the delay.

    If I may suggest, you could try plugin solution: https://www.ads-software.com/plugins/login-or-logout-menu-item/.

    Hope that helps.

    Regards,
    Kharis

    Thread Starter pmoffat

    (@pmoffat)

    the plugin is to add the login/logout to the menu
    i want to have it in the header as it is currently
    is this not something that you have thought about?

    Hi @pmoffat,

    > is this not something that you have thought about?

    I think that plugin is the easier solution. If it doesn’t meet your need, try adding this PHP snippet to a child theme’s functions. Or you can use Code Snippets plugin to apply the same code directly from your site’s dashboard without child theme.

    add_action('sydney_header', function(){
    
      ?>
      <div class="header-extra-links">
        <div id="loginrow">
          <p>
            <a href="https://www.leighandwestclifftennis.org.uk/wp-login.php">Login</a> | 
            <a href="https://www.leighandwestclifftennis.org.uk/wp-login.php?action=register">Register</a>
          </p>
        </div>  
      </div>  
      <?php
    
    }, 999);
    
    add_action('wp_footer', function(){
      ?>
    	<script type="text/javascript">
    jQuery(function($) {
    
      if( $('.header-extra-links').length ) {
        $('.header-extra-links').remove().clone().insertBefore($('.site-header-inner'));
      }
    
    });
    	</script>
      <?php
    }, 9999);

    Then add this CSS code to Additional CSS.

    .main-header .container {
      position: relative;
    }
    
    .main-header .header-extra-links {
      position: absolute;
      top: 0;
      right: 0;
    }

    Hope that helps.

    Regards,
    Kharis

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Add login to sydney theme using new header’ is closed to new replies.