- This topic has 5 replies, 3 voices, and was last updated 4 years, 5 months ago by .
Viewing 6 posts - 1 through 6 (of 6 total)
Viewing 6 posts - 1 through 6 (of 6 total)
- The forum ‘Tips’ is closed to new topics and replies.
Events Made Easy › Forums › Tips › How to add placeholders to the title tag in events and locations
Hi,
How can I add the #_TOWN in the title tag?
theres is a field or a function? or where I edit the code of the template to add this?
thanks!
Changing the title of the page is currently not possible. I imagine a filter would help, but an easy wor around would be to use a page template without title and just add your own via the eme single format template
thanks!
that’s my solution:
in functions.php delete auto title tag render feature:
remove_action( 'wp_head', '_wp_render_title_tag', 1 );
Then in options/others add the <title>
at Extra event html headers
To get the normal title at the normal pages, in the headers.php from your template add before de </header> tag:
<?php if (!eme_is_events_page()) { ?>
<title><?php echo get_the_title().' | '.get_bloginfo( 'name' ); ?></title>
<?php }?>
there’s an eme_is_events_page() function similar for location pages?
thanks!!!!
Thanks, I moved this to “Tips”!
Btw: the same function can be used for locations.
And also: check out eme_is_single_event_page(), eme_is_single_location_page() and their companions (in eme_functions.php)
thanks!
could you change the title to something like “add placeholders to the title tag in events and locations”?
I just wanted to mention that this solved my issue as well — I was having issues getting Divi/Rank Math to play nicely with EME titles.
I had to add a bit of code before your the remove_action( 'wp_head', '_wp_render_title_tag', 1 );
section to get it to work, but it finally did.
The code I used was found on the RankMath site and is
add_action( 'template_redirect', 'rankmath_disable_features' );
function rankmath_disable_features() {
if( is_page( '800' ) ) {
remove_all_actions( 'rank_math/head' );
}
}
Just wanted to share this in case anyone came across this looking for similar