• Hey all! I have a question that hopefully has a simple answer. I wanted to manipulate one of my buttons to take the logged in user to the page that shows their own posts.

    For example, if user cindy203 was logged in, and she clicked the ‘my profile’ button, she would be automatically taken to wesbitename.com/author/cindy203

    So, I already have the code for the My Profile button (which I copied from a logout button) and it looks like this:

    $buttons[‘My Profile’] = ( $sl_options[‘redirect_logout’] == ‘custom’ && $sl_options[‘redirect_logout_url’] != ” ) ? wp_logout_url( $sl_options[‘redirect_logout_url’] ) : wp_logout_url( $this->current_url() );

    I am looking to manipulate this to where the logged in user can see their posts. Where do I insert the link to pull up websitename.com/author/cindy203?

    Thanks so much in advance. Any help would be appreciated.
    -C

Viewing 1 replies (of 1 total)
  • I would give this a shot

    <a href="<?php echo home_url() . '/author/' . get_the_author_meta( 'user_login', wp_get_current_user()->ID ); ?>" >My personal page</a>

    Placement of this code depends on the theme you are using but would need to go into your template somewhere.

    If you aren’t familiar with editing themes and would rather not change any files the other option is to add this into a sidebar using a widget.

    You can achieve that by installing this widget here. Then adding it to the sidebar widget area you wish to have it show up and add the above code.

Viewing 1 replies (of 1 total)
  • The topic ‘How to link a button to author's posts page’ is closed to new replies.