Skip to content

Instantly share code, notes, and snippets.

@jameskoster
Created February 3, 2012 12:47
Show Gist options
  • Save jameskoster/1730015 to your computer and use it in GitHub Desktop.
Save jameskoster/1730015 to your computer and use it in GitHub Desktop.
WooCommerce - My Account link
<?php if ( is_user_logged_in() ) { ?>
<a href="<?php echo get_permalink( get_option('woocommerce_myaccount_page_id') ); ?>" title="<?php _e('My Account','woothemes'); ?>"><?php _e('My Account','woothemes'); ?></a>
<?php }
else { ?>
<a href="<?php echo get_permalink( get_option('woocommerce_myaccount_page_id') ); ?>" title="<?php _e('Login / Register','woothemes'); ?>"><?php _e('Login / Register','woothemes'); ?></a>
<?php } ?>
@mattsafaii
Copy link

Does this still work?

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