BuddyBoss Home – Web Support Forums Themes Boss. theme Site Title link conditions

Tagged: , ,

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

    #35921

    Anonymous
    @

    Hi,

    How could I make the site title link just above the buddypanel link to a different page for logged in members? I currently do not have a logo uploaded so I am dealing with a site title. I’d like the visitor link to be as it is, just the front page site url, but for members I would like for it to be a specific page, just to clarify.

    By the way, loving the new theme. A minimal feel (that’s my style), yet bold and creative as well.

    Ryan

    Answers

    #35966

    Alyssa
    Participant
    @alyssa-buddyboss

    @ryanmaler copy header.php from the parent theme and paste into the child theme.
    Then edit line 313 from this:
    <?php echo esc_url( home_url( '/' ) ); ?>
    to this:
    <?php if(!is_user_logged_in()){echo esc_url( home_url( '/' ) );}else{echo '[insert new URL here]';} ?>

    #35993

    Anonymous
    @
    #35994

    Anonymous
    @

    <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' ) ); ?>">

    #36004

    Alyssa
    Participant
    @alyssa-buddyboss

    @ryanmaler I don’t see any errors in this code. Did you edit line 321 or 313? Perhaps you accidentally made another edit on another line? Try recopying the file and try again.

    #36014

    Anonymous
    @

    @tjchester,

    When I copy in a new header.php from boss to boss_child line 313 is </h1>. This is making things a little tricky since we have different line numbers. So, could give me the location a little more broadly. Is it under <!– Look for uploaded logo –> or <!– If no logo, display site title and description –>. I would think the second, because I do not have a logo just text, so that’s why I tried editing line 321. What’s your suggestion?

    #36026

    Alyssa
    Participant
    @alyssa-buddyboss

    @ryanmaler it is under the second, after recopying and pasting the code again did it work?

    #36029

    Anonymous
    @

    @tjchester,

    I’m sorry giving you a hard time over a small tweak. I’m still getting this error, “Parse error: syntax error, unexpected ‘{‘ in /home4/ryan/public_html/mysite.com/wp-content/themes/boss-child/header.php on line 321”.
    Here is that small portion of the code edited to your suggestion.

                <!-- If no logo, display site title and description -->
                <?php else: ?>
                    <div class="site-name">
                        <h1 class="site-title">
                            <a href="<?php if(!is_user_logged_in(){echo esc_url( home_url( '/' ) );}else{echo 'http://mysite.com/action-news/';} ?>" title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>">
                                <?php bloginfo( 'name' ); ?>
                            </a>
                        </h1>
                        <p class="site-description"><?php bloginfo( 'description' ); ?></p>
                    </div>
                <?php endif; ?>
    #36050

    Alyssa
    Participant
    @alyssa-buddyboss

    @ryanmaler I fixed the code in this post: https://www.buddyboss.com/support-forums/topic/site-title-link-conditions/#post-35966
    Now it should work.

    #36059

    Anonymous
    @

    @tjchester,

    Success! Thank you sir.

    #36061

    Alyssa
    Participant
    @alyssa-buddyboss

    NP

Viewing 11 posts - 1 through 11 (of 11 total)
  • The question ‘Site Title link conditions’ is closed to new replies.