- This topic has 13 replies, 2 voices, and was last updated 5 years, 12 months ago by Leo.
-
AuthorPosts
-
April 14, 2018 at 6:34 am #550181ilovemusic
Hey!
Here back again. Almost done completing my website with your beautiful and flexible builder. I need help with a little issue.
I am currently using my navigation as a header for my webpage and have disabled the site navigation logo. I am wondering how I can link my Primary Navigation Logo to redirect to the home page when someone clicks on it.
At the moment, the logo just refreshes the same page.
Best Regards,
Abhishek VarmaApril 14, 2018 at 9:10 am #550321LeoStaffCustomer SupportHi there,
That’s weird. It should link to home page by default (this page is using the same method.)
For some reason your navigation logo doesn’t have a link which is why is linking to the same page.
Any custom functions to change the navigation logo output?
If not can you try #1 here to eliminate plugin conflict first? https://docs.generatepress.com/article/debugging-tips/
April 18, 2018 at 3:14 am #553585ilovemusicHi Leo,
Thanks for your reply. I went ahead and checked custom functions.
You are right. This problem is being caused because I’ve changed my Blog Logo and Url for all my Blog pages and posts.
I’ve done this using the method you had mentioned earlier
Link to discussion: https://generatepress.com/forums/topic/page-header-logo-change-url/I added the functions you had asked me:
add_filter( ‘generate_logo_href’,’generate_add_custom_logo_href’ );
function generate_add_custom_logo_href()
{
if ( is_home() )
return ‘http://www.ilovemusic.edu.in/Blog’;
}On deactivating this snippet, the home page and other pages URL redirects to the Home Page, however I would still like to keep a different Blog Logo and URL.
Any suggestion??
April 18, 2018 at 8:51 am #553886LeoStaffCustomer SupportThis is the exact function you are using?
add_filter( 'generate_logo_href','generate_add_custom_logo_href' ); function generate_add_custom_logo_href() { if ( is_home() ) return 'http://yourURL.com'; }
It should only apply to the blog page since there is a conditional tag added.
April 18, 2018 at 11:52 pm #554398ilovemusicYes Leo,
Its exactly that with my Blog URL in the “yourURL” area
add_filter( ‘generate_logo_href’,’generate_add_custom_logo_href’ );
function generate_add_custom_logo_href()
{
if ( is_home() )
return ‘http://www.demo.ilovemusic.edu.in/Blog’;
}– The Logo’s on the Pages still just refreshes the page
– The Blog logo re-directs correctly to the Blog Page.April 19, 2018 at 9:06 am #554902LeoStaffCustomer SupportActually I just noticed that your blog page is not the default WordPress blog page. It is just a static page built from Elementor
Can you try this instead?
add_filter( 'generate_logo_href','generate_add_custom_logo_href' ); function generate_add_custom_logo_href() { is_page( 'erg-services' ) { return 'http://test.ergapc.co.uk/erg-services/'; } return 'http://HomePageURL.com'; }
Also what are you using to switch the logo?
April 19, 2018 at 11:34 pm #555384ilovemusicHey Leo,
My apologies, should have mentioned that!
I used the Snippet you provided above.However, no change.
– The Blog Logo redirects correctly to the Blog URL.
– But the Normal Logo on our course pages and other pages, just refreshes the pages. πRegards,
AVApril 20, 2018 at 8:55 am #555800LeoStaffCustomer SupportCan you try the edited code above?
https://generatepress.com/forums/topic/linking-navigation-logo-to-home-page/#post-554902April 20, 2018 at 11:41 pm #556238ilovemusicHey Leo,
So the code works. However there is one last issue.
The Blog logo is not redirecting to the Blog main page on individual posts for the Blog.
It redirects to the Home Page of the Website.Any way of sorting that?
April 21, 2018 at 9:02 am #556573LeoStaffCustomer SupportEdited the code again.
Let me know.
April 22, 2018 at 3:49 am #557113ilovemusicHey Leo,
So I updated with the new edited code that you edited above, which was…
add_filter( ‘generate_logo_href’,’generate_add_custom_logo_href’ );
function generate_add_custom_logo_href()
{
if ( is_page( 2467 ) && is_single() ) {
return ‘http://www.demo.ilovemusic.edu.in/blog’;
}return ‘http://www.demo.ilovemusic.edu.in’;
}However this still doesn’t do whats required and also unlinks the Blog Main Page URL with the Blog and now redirects to home page. π
I’m using the Generate Header option to change the logo for our Blog Page as suggested by Tom earlier.
April 22, 2018 at 9:00 am #557275LeoStaffCustomer SupportApril 26, 2018 at 4:05 am #560833ilovemusicHey Leo,
Thank You! It works fine now!!
Best Regards,
Abhishek V
Team I Love Music AcademyApril 26, 2018 at 8:08 am #561055LeoStaffCustomer SupportNo problem π
-
AuthorPosts
- You must be logged in to reply to this topic.