Archived topic
Home Link - best practice for combining business page with blog
3 replies · Started by Rolf on November 15, 2018
Hi, I recently launched / migrated 2 separte WordPress sites into one.
Before relaunch: one wp install for the business page, one for the blog
Now: one for both.
Question: When someone clicks the company logo when on a single post, the user lands on the sites homepage, not the blog page. On the business frontpage the blog is featured very far down, not a good experience when a user just wants to check out the blog.
Is there a way - or a recommendation to have a "blog" home link, which is only shown when on the single blog post page. Or a way to show a sub-navigation / sub-logo which is only present on the /blog pages/posts?
Thanks for tips!
Hi there,
So you'd like to change the logo link to the blog home page when on single posts?
Let me know :)
Yes could be one solution.
Try this PHP snippet:
add_filter( 'generate_logo_href','lh_single_logo_href' );
function lh_single_logo_href()
{
if ( is_single() ) {
return 'http://LOGO-URL-ON-SINGLE-POSTS';
}
return 'http://LOGO-URL-ON-OTHER-PAGES';
}
Adding PHP: https://docs.generatepress.com/article/adding-php/
Make sure to add the actual URL you want.