Viewing 6 posts - 1 through 6 (of 6 total)
  • Question

    #37081

    Anonymous
    @

    @tjchester,

    I’d like to have the mobile header site title link change once logged in. Is that possible? I have already made the change on desktop, but am not sure how to do it for mobile. Also, how could I remove the menu icon on the left of the mobile header from view until logged in? Sorry about the blocked out content, working on a secret project.

    Answers

    #37090

    Alyssa
    Participant
    @alyssa-buddyboss

    @ryanmaler this is extremely similar to this request: https://www.buddyboss.com/support-forums/topic/can-i-make-the-logo-direct-to-site-activity-just-for-logged-in-users/

    Just substitute the line of code for the site title instead of the logo in header.php (should be adjacent to it)

    Add this to custom.css to hide menu for logged out users:

    #custom-nav-wrap{display:none;}
    .logged-in #custom-nav-wrap{display:block;}
    #37092

    Anonymous
    @

    @tjchester,

    Took care of the icon. Thanks. But I was not able to get the site title link to change on mobile. I placed this on line 353 under the mobile header section:

    <a href="<?php if(!is_user_logged_in()){echo esc_url( home_url( '/' ) );}else{echo '/action-news/';} ?>" title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" rel="home">

    I put it in place of:

    <a href="<?php echo esc_url( home_url( '/' ) ); ?>" title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" rel="home">

    Was that not correct? What did I do wrong?

    #37101

    Alyssa
    Participant
    @alyssa-buddyboss

    @ryanmaler Look for this code:
    <a class="mobile-site-title" href="<?php echo esc_url( home_url( '/' ) ); ?>" title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a>
    Replace with this:
    <a class="mobile-site-title" href="<?php if(!is_user_logged_in()){echo esc_url( home_url( '/' ) );}else{echo '/action-news/';} ?>" title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a>

    #37110

    Anonymous
    @

    Got it. Thanks @tjchester.

    #37212

    Alyssa
    Participant
    @alyssa-buddyboss

    NP

Viewing 6 posts - 1 through 6 (of 6 total)
  • The question ‘Mobile Header’ is closed to new replies.