i need a trick about wordpress.
i want replace a word from my displaying post title at whole website.(not permantly or not on database. only show temporary at browser.)
for example: i want change post word to text
here is list my post titles:
1- This is first post title
2- This is second post title
3- This is third post title
4- This is fourth post title
here is my new post title list:
1- This is first text title
2- This is second text title
3- This is third text title
4- This is fourth text title
How can i do this?
3
Answers
in your functions.php:
go to your single.php in your theme path
find
get_the_title
orthe_title
, for each one you may change the title_changer function with the specific functions used in thesingle.php
you can do using Jquery, but you’ve to change few things as according to your HTML tags
h2.entry-title HERE you’ve to change your post title CSS class and I’m hoping there is an anchor tag inside heading, so I’m replacing the HTML of anchor tag, Please change accordingly and add in your functions.php file.
This is my approach I don’t know how good it is but it works.
First I create this function globally in functions.php to I don’t repeat it inside the function.
After that I create
In this way, my menu stays ok and I change what I needed. You can tweak this for your needs.