Archived topic
Changing sticky bar to have different output for single post
5 replies · Started by jasmeet on July 21, 2019
Hello
Had been figuring out if GP theme has the enhanced functionality with sticky bar to have different output for Single Post Templates somewhat like seen here apart from the usual output seen globally -
https://slackhq.com/etiquette-tips-in-slack
as the sticky bar changes to output logo+Current post (being read)+social sharing icons
Kindly guide if there is such option
Hi there,
The search to icons can likely be done with some CSS.
However, the post title would require a custom solution unfortunately.
Let me know if this helps :)
Hi
Thanks for the response
However, Rendering the post title is more important from UX perspective also. Social icons sticky is also fine which is being managed through plugin
Can you kindly suggest for some solution here
Ok let's try one step at the time.
Add this PHP to create a shortcode to output the title:
add_shortcode( 'the_title', function() {
return get_the_title();
} );
Adding PHP: https://docs.generatepress.com/article/adding-php/
Then create a new hook element with <div class="menu-title">[the_title]</div> and use the inside_navigation hook:
https://docs.generatepress.com/article/hooks-element-overview/
Set display rules to all posts.
Then I'll tackle the CSS.
Hi
Thanks for providing the precise steps however, the same doesn't render blog title as envisaged. I might be missing something
Can you kindly review again
Hi there,
Is the code live right now?
If not, what about it isn't working, exactly?
Let me know :)