Archived topic
Combining Page Header Element Template Tags with Elementor Template
3 replies · Started by Marcus on August 29, 2018
I ran across this post where David mentioned there was a way to integrate Page Header Element template tags within Elementor to take advantage of dynamic titles, etc. Here's the post:
https://generatepress.com/forums/topic/merged-header-elementor/#post-371139
I was able to create a test Elementor template and add it within the GP Header Element using a shortcode no problem. However, when I tried to use a template tag within Elementor, the text is just rendered out as {{post_title}} instead of, say, the page/post title.
Just looking for some pointers on how best to stick with my GP Page Header Element and templates tags, but sprinkle in some Elementor widgets or layouts… and make them dynamic where possible.
Thank you!
The template tags provided in Elements will only work if they exist within the Elements content. They won't work inside Elementor unfortunately.
You'd need to build a shortcode to display the title instead:
add_shortcode( 'content_title', function() {
return get_the_title();
} );
Then you'd use [content_title] in Elementor.
Thank you for the code and explanation Tom! I'll give that a shot!
No problem! :)