Posted: January 12, 2016 at 9:50 am
It appears that the function of the_title() is no longer working properly. Not sure if this is intentional or a bug. If intentional, what can I replace this function with to get the name of the event to use as the title. For example, this was the line of code I had in my content-espresso_events-details file: This now outputs as: As you can see something change that caused the_title() to output weirdly wrapping itself around the code in front of it. This was working before and outputting the title of the event. Thanks in advance. |
|
Sorry logic didn’t post right. For example, this was the line of code I had in my content-espresso_events-details file: This now outputs as: As you can see something change that caused the_title() to output weirdly wrapping itself around the code in front of it. This was working before and outputting the title of the event. |
|
Hi there, It turns out this is not a bug in EE, it’s a mistake in your template code. This is because the_title() should never be used for a title attribute. This is because the_title() can have filters run on it to add extra html (in this case, it’s the Event Status that gets appended to the actual html title display). The correct way to return the title for an html title attribute is use the_title_attribute(). https://codex.wordpress.org/Function_Reference/the_title_attribute |
|
hmm it was working before but thanks, that works too. ๐ |
|
Sure it will work, but if anything uses the the_title() filter you’ll end up with unexpected output. The codex article I linked to explains more. |
|
The support post ‘the_title() not working’ is closed to new replies.
Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.