Skip to:
Content
Pages
Categories
Search
Top
Bottom

[Resolved] URGENT : Change Logo Url to Profile Url if Logged In

  • Avatar of luckyrajiv
    luckyrajiv
    Participant

    @luckyrajiv

    Hi,

    When a User is Logged Out, if Logo is clicked it should go to Homepage.
    When a User is Logged In, if Logo is clicked it should go to Profile Page. ( Because i have hidden the home page for logged in users ).

    My Current Code in Header for Logo and Its URL

    <!-- #logo -->
      <div id="logo">
        <?php if (is_front_page()) { ?><h1><?php } ?>
          <a title="<?php bloginfo( 'name' ); ?>" href="<?php echo home_url(); ?>">
          <?php if (of_get_option('st_logo')) { ?>
          <img alt="<?php bloginfo( 'name' ); ?>" src="<?php echo of_get_option('st_logo'); ?>">
          <?php } else { ?>
          <?php bloginfo( 'name' ); ?>
          <?php } ?>
          </a>
         <?php if (is_front_page()) { ?></h1><?php } ?>
      </div>
    <!-- /#logo -->
    

    Please help Me fix this URGENT.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Avatar of Henry
    Henry
    Participant

    @henrywright-1

    <?php if ( is_user_logged_in() ) { ?>
          <a href="/<?php echo bp_core_get_username( bp_loggedin_user_id() ); ?>" title="Profile"><img src="logo.png" alt="Logo" /></a>
    <?php } else { ?>
          <a href="/" title="Home"><img src="logo.png" alt="Logo" /></a>
    <?php } ?>
    Avatar of luckyrajiv
    luckyrajiv
    Participant

    @luckyrajiv

    Thanks a Lot Henry.

    Avatar of luckyrajiv
    luckyrajiv
    Participant

    @luckyrajiv

    TOPIC IS RESOLVED.

Viewing 3 replies - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.