Replace text (login / logout) by icon or image

This topic contains 3 replies, has 2 voices, and was last updated by  Vinod Dalvi 2 weeks, 1 day ago.

  • Author
    Posts
  • #2644
    bmail
    Participant
    • Topics: 1
    • Replies: 1

    Hello,

    I wonder if it’s possible to replace the text “login”, “logout”, just by an icon or an image ?
    Obviously, one icon or image for “login”, and another for “logout”.

    I can’t use just a css class because the text is different according we are connected or not …

    Thanks in advance for any idea.

    Best regards

  • #2653
    Vinod Dalvi
    Keymaster
    • Topics: 0
    • Replies: 244

    Hi Bmail,

    I hope you are well today and thank you for your question.

    You can add different classes to them as shown in the attached screenshot and then develop custom CSS code to display image or icon istead of text.

    Best regards,
    Vinod Dalvi

    Attachments:
    You must be logged in to view attached files.
  • #2659
    bmail
    Participant
    • Topics: 1
    • Replies: 1

    Hello Vinod,

    Thanks for your answer, but it’s more complex …
    If I create 2 separate entries in the menu, with LOGIN and LOGOUT, I known how to hide the text and add an icon or image, in assigning a css class for each, as you show me.

    But, how to do it if I want to use an entry “LOGIN/LOGOUT” according the state of the connection ? I can only assign one class for one entry in the menu.

    Have a good day and thanks for your work.

    Best regards
    Bertrand

  • #2660
    Vinod Dalvi
    Keymaster
    • Topics: 0
    • Replies: 244

    The WordPress assigns logged-in class to the body tag of your site when the user is logged in so if you are using LOGIN/LOGOUT entry then you can also refer this class to distinguish between whether the LOGIN or LOGOUT entry is displayed in the menu.

You must be logged in to reply to this topic.