This topic contains a post which is marked as Best Answer. Press here if you would like to see it.
*

tassonfl

  • ***
  • 40 posts
Hide My Account button after logging in
« on: March 13, 2023, 07:02:43 AM »
Hi, I would like that after logging in, the My Account button disappears in the Header section in Desktop mode.
Do you have any suggestions?
Thank you

Code: [Select]
<a class="account btn btn-white" href="<?php echo (!osc_is_web_user_logged_in() ? osc_user_login_url() : osc_user_dashboard_url()); ?>">
        <?php if(!osc_is_web_user_logged_in()) { ?>
          <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 496 512" width="22" height="18"><path d="M144 112v51.6H48c-26.5 0-48 21.5-48 48v88.6c0 26.5 21.5 48 48 48h96v51.6c0 42.6 51.7 64.2 81.9 33.9l144-143.9c18.7-18.7 18.7-49.1 0-67.9l-144-144C195.8 48 144 69.3 144 112zm192 144L192 400v-99.7H48v-88.6h144V112l144 144zm80 192h-84c-6.6 0-12-5.4-12-12v-24c0-6.6 5.4-12 12-12h84c26.5 0 48-21.5 48-48V160c0-26.5-21.5-48-48-48h-84c-6.6 0-12-5.4-12-12V76c0-6.6 5.4-12 12-12h84c53 0 96 43 96 96v192c0 53-43 96-96 96z"/></svg>
        <?php } else { ?>
          <img src="<?php echo eps_profile_picture(osc_logged_user_id(), 'medium'); ?>" alt="<?php echo osc_esc_html(osc_logged_user_name()); ?>" width="32" height="32"/>
        <?php ?>
       
        <?php echo (osc_is_web_user_logged_in() ? __('My Account''epsilon') : __('Login''epsilon')); ?>
      </a>

*

Wiz

  • ****
  • 148 posts
Re: Hide My Account button after logging in
« Reply #1 on: March 13, 2023, 01:07:09 PM »
You should be looking at your CSS, specifically responsive.css, and not php code.

*

MB Themes

Re: Hide My Account button after logging in
« Reply #2 on: March 13, 2023, 04:06:18 PM »
You can add isMobile / isDesktop / isTablet classes to button you want to show/hide
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

tassonfl

  • ***
  • 40 posts
Re: Hide My Account button after logging in
« Reply #3 on: March 13, 2023, 05:53:15 PM »
You should be looking at your CSS, specifically responsive.css, and not php code.

After loggin is impossible modify CSS.
Only in code php
Thank you

*

tassonfl

  • ***
  • 40 posts
Re: Hide My Account button after logging in
« Reply #4 on: March 13, 2023, 05:56:30 PM »
You can add isMobile / isDesktop / isTablet classes to button you want to show/hide

After login the button "Login" in header it turns into My Account.
This is the string:

<?php echo (osc_is_web_user_logged_in() ? __('My Account', 'epsilon') : __('Login', 'epsilon')); ?>

I would like it to disappear instead of turning into "My account".

Marked as best answer by frosticek on March 16, 2023, 11:30:13 AM
*

MB Themes

Re: Hide My Account button after logging in
« Reply #5 on: March 15, 2023, 02:02:47 PM »
@tassonfl
Code: [Select]
...class="account btn btn-white isMobile"...
2nd question:
Code: [Select]
<?php if(!osc_is_web_user_logged_in()) { ?>
<a class="account btn btn-white" href="<?php echo (!osc_is_web_user_logged_in() ? osc_user_login_url() : osc_user_dashboard_url()); ?>">
        <?php if(!osc_is_web_user_logged_in()) { ?>
          <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 496 512" width="22" height="18"><path d="M144 112v51.6H48c-26.5 0-48 21.5-48 48v88.6c0 26.5 21.5 48 48 48h96v51.6c0 42.6 51.7 64.2 81.9 33.9l144-143.9c18.7-18.7 18.7-49.1 0-67.9l-144-144C195.8 48 144 69.3 144 112zm192 144L192 400v-99.7H48v-88.6h144V112l144 144zm80 192h-84c-6.6 0-12-5.4-12-12v-24c0-6.6 5.4-12 12-12h84c26.5 0 48-21.5 48-48V160c0-26.5-21.5-48-48-48h-84c-6.6 0-12-5.4-12-12V76c0-6.6 5.4-12 12-12h84c53 0 96 43 96 96v192c0 53-43 96-96 96z"/></svg>
        <?php } else { ?>
          <img src="<?php echo eps_profile_picture(osc_logged_user_id(), 'medium'); ?>" alt="<?php echo osc_esc_html(osc_logged_user_name()); ?>" width="32" height="32"/>
        <?php ?>
       
        <?php echo (osc_is_web_user_logged_in() ? __('My Account''epsilon') : __('Login''epsilon')); ?>
      </a>
<?php ?>
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

tassonfl

  • ***
  • 40 posts
Re: Hide My Account button after logging in
« Reply #6 on: March 15, 2023, 08:04:57 PM »
Work great. Thank you!