Add text to the first “title”=>get_the_title($post->ID), and shorten

Question

I use this code to display the title :

 $imageAttr = array(
                "class"=>"alignnone size-medium",
                "alt"=>get_the_title($post->ID),
                **"title"=>get_the_title($post->ID),**
        );

Now I want to add a text the title, for example "hi"
And shorten a few words from the end of the title

That is, if this is my title :

"how are you"

I want it to be like this:
"hi how are"

0
sa eu 1 month 0 Answers 8 views 0

Leave an answer