Posted: September 4, 2018 at 1:35 pm
|
Hi there! On our event archive page, there is some HTML being output above each event title (see image below). How can we remove this so that the events appear properly? Also, how can we change the title of that page? Thanks! |
Hi, The trouble there with the HTML is a mistake in the WordPress theme. Somewhere the theme is using the_title() when instead it should use the_title_attribute(). There’s further explanation here. If you need further help with correcting the code in the theme we’ll be glad to help, is there a way we can download a copy of it? The title of the page would also be generated by the theme so you’d likely make a modification to the theme in order to change the title of that page. |
|
|
Thanks for the quick reply. I would love some help getting this resolved. We are using the Zephyr theme. I’m not sure how to send you a copy of it. Any ideas? |
A dropbox link or similar works very well. |
|
|
Gotcha. Here’s the DL link ==> Theme Thanks! |
To fix the html being output on the page, you’ll open the Zephyr theme’s framework/templates/blog/listing-post.php file, then on line 221 you’ll find this: |
|
Then, to change the title of the event listing page, you can add the following filter function:
The above will change the title to “Upcoming Events”, you can change the string to something else. You can add the above to a functions plugin or into your WordPress child theme’s functions.php file. It may also help to contact the theme author and ask them to fix the usage of the_title() in the /listing-post.php file so you’ll have that fix going forward in future theme updates. |
|
|
Thanks a lot that worked perfectly! |
|
One last question on this. The title in the h1 tags now appears correct with that code. How do I get the page title in the head to match the updated title on the page? Thanks! |
Do you mean what’s in the
|
|
|
Yes, the title tag is what I meant, thanks. I added this code in and the title still remains “Archives: Events”. Any ideas? |
Another plugin may be running a filter on the title tag and it’s overriding the other function. One way to possibly work around that is change the last line above to: |
|
The support post ‘Event archive page – HTML being output onto page’ 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.