Change Text through a class

Asked

Viewed 94 times

0

Good morning everyone, I’m trying to change a text of a link on a Wordpress site that is the name of a category, but when I update the page using the code below is displayed quickly the old text and then updates to the new one. I have no experience with Javascript, I wonder if there is a way when refresh the page already display updated text without quickly displaying old text.

jQuery(document).ready(function(){
jQuery("li.entry-category a").html("Veja todos os articulistas"); }); 
  • The script in Wordpress gets in the head?

  • Hello friend, this script I inserted using a custom code inside the page template, I do not know exactly.

  • Just try putting jQuery("li.entry-category a").html("Veja todos os articulistas");, without the jQuery(document).ready(function(){}... if it does not work unfortunately it is necessary to ready, that is only fired when elements are loaded on the page.

  • I tested here friend, but did not continue with the same behavior, I think I will not be able to make this change because the class I am going through the script is used by all categories of the site, and is changing the text throughout the site, I have the ID of the specific category I would like to change but I don’t think it would be possible.

  • You can’t change that at the source anyway?

  • Why not change within Wordpress admin?

Show 1 more comment
No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.