Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • usman tariq
    Participant

    i want to change the title when a user logs in to his account for example, the initial text is “this is a widget” and when a user logs in the site the text changes to “welcome to the widget” is this possible?
    any help will be appreciated. And thank you.

    Hi Usman,

    Sorry for the delay. I missed to reply for your query.

    UFW provides an “box” where you can place “regular widgets”

    So widgets are common. It does not matter whether it is in sidebar or UFW.

    Below are my suggestions:

    1) Find if there are any plugin which allows to change widget title as you need
    2) Find/write custom code to change the title of your widget. Follow this link for an idea – https://wordpress.stackexchange.com/a/290010/3914 Here they are changin the title of recent posts widget.
    3) Raise a topic in above forum and get some help on how to change the title for whatever widget on any criteria as you need.

    If you are trying to change the title of the “widget box” itself then that comes under UFW.
    But right now there is no option to change the “widget box” title dynamically. I can share some code if needed which you need to edit.

    Thanks,
    Aakash

    usman tariq
    Participant

    Hi Aakash,
    Sir first your plugins are awesome.
    Second if you could share some code or guide me how to do this then do let me know. And i’m still looking other options and if i solve this i’ll let you know. Thank you.

    Hi Usman,

    I saw your website. Can yoh please confirm if you want to change “You need to login for Inquiry Cart” ?

    If yes, then I can share code to change this after login.

    Thanks

    usman tariq
    Participant

    Hi Aakash,
    yes if it is possible then please do share the code with me. thank you

    Hi Usman,

    Please go to plugin editor, select ultimate floating widget, select includes -> display.php

    At line no 120, paste the following code.

            if( in_array( $id, array( '3', '4' ) ) ){
                $title = is_user_logged_in() ? 'My title when user is logged in' : 'Not logged in';
            }

    Here ‘3’, ‘4’ are the ID of the widget box for which you need to change. Replace that with your ID, add or remove IDs as needed like in the example.

    Replace the title also as needed. First one is title when user is logged in. Second is when not logged in.

    When the plugin upgrades, this changes will go.
    I’ll provide a WordPress hook in the next version so that you don’t need to change it directly in the code. For now please use this.

    Thanks

    usman tariq
    Participant

    Dude thank you and the extension is awesome, plus its working fine.

    Hi Usman,

    Happy that you got a solution !

    Thanks,
    Aakash

Viewing 8 posts - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.

Subscribe for updates

Get updates on the WordPress plugins, tips and tricks to enhance your WordPress experience. No spam. View newsletter