I want to add "my posts" to main menu. By clicking on this, each logged-in user will see his/her own posts.
I don't know how the link structure should be to add on the menu.
You could use this:
<a href="<?php echo home_url() . '/author/' . get_the_author_meta( 'user_login', wp_get_current_user()->ID ); ?>" >My Posts</a>
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
3 years ago
2 years ago