skip to Main Content

i got issue for updating new logo of twitter with the X new one ,
so i updated the font awesome package , but i wanna make a php function that can find the class of old icon " fa fa-twitter " to change with the new class of X "fa-brands fa-x-twitter"

2

Answers


  1. I suggest using jQuery or js to do that.
    For jQuery you can do something like:

    $('.fa.fa-twitter').addClass('.fa-brands.fa-x-twitter').removeClass('.fa.fa-twitter');
    

    For js you need to select all your instances (querySelectorAll or getElementsByClassName) then loop through them and use classList.add and classList.remove to manipulate the classes.

    Login or Signup to reply.
  2. just add this line to end of your fontawsome CSS file to show X logo as twitter old logo :

    .fa-twitter:before{content:"e61b"}
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search