• Resolved gamicord

    (@gamicord)


    I wanted to display my logged in User’s Username or Display Name in WP backend Dashboard.

    So I entered the below Code:

    function show_loggedin_function() {
        global $current_user; wp_get_current_user();
        if ( is_user_logged_in() ) {
            echo $current_user->display_name;
        } else {
            echo '<a href="' . wp_login_url() . ' ">Login</a>';
        }
    } 
    add_shortcode( 'show_loggedin_as', 'show_loggedin_function' );

    Unfortunately, when logged in, it still shows the shortcode instead of the Username, as can be seen here— https://prnt.sc/5xUmDzO_Wt7A

    1.) Please, do you know how I can fix this?

    Or, do you have a better code that can help me solve this issue?

    Regards.

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Support VUM Support – Jhay

    (@jhayvum)

    Hello @gamicord,

    Unfortunately, White Label CMS does not currently support shortcodes on our Basic HTML Dashboard, but we will add this to our future release.

    Right now, you can only achieve this when using Elementor or Beaver Builder.

    Thread Starter gamicord

    (@gamicord)

    I used Elementor Shortcode widget, the result is the same. It showed the shortcode instead of the Username.

    Probably it’s because you’ve not supported shortcodes in the basic Dashboard yet.

    Could you provide a short term solution? — pending when you complete the final implementation of shortcodes in the basic dashboard?

    Regards.

    Plugin Support VUM Support – Jhay

    (@jhayvum)

    Hello,

    I tried your shortcode in Elementor and it’s working fine from my end please check https://d.pr/i/DbYUNh.

    Thread Starter gamicord

    (@gamicord)

    Thanks very much Sir, for your reply. It helped me a lot.

    Now, don’t mind me. I’m a moron. I was supposed to use the Elementor “Shortcode Widget“, but I used the Text widget. And that’s why it didn’t work.

    When I saw your screenshot, and saw that you used the shortcode widget, I decided to use the shortcode widget like you, and it worked.

    Thanks for steering me in the right direction.

    Regards.

    Plugin Author Video User Manuals

    (@videousermanuals)

    No problem. Glad we got it solved.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Shortcode displayed instead of Username’ is closed to new replies.