- This topic has 29 replies, 3 voices, and was last updated 8 years, 2 months ago by
Leo.
-
AuthorPosts
-
June 30, 2017 at 2:30 pm #342213
Abdul Rehman
Hi
How can I create sticky secondary navigation instead of primary? I can’t switch the settings to make primary secondary and secondary primary one, since I am using navigational logo…June 30, 2017 at 2:43 pm #342221Leo
StaffCustomer SupportHi there,
I would switch the settings so that the one you want sticky is the primary and then just add the navigation logo using GP hooks:
https://docs.generatepress.com/article/generate_inside_secondary_navigation/Something like this:
add_action( 'generate_inside_secondary_navigation','lh_secondary_navigation_logo' ); function lh_secondary_navigation_logo() { ?> <div class="secondary-navigation-logo"> <img src="URL TO NAVIGATION LOGO" alt="" /> </div> <?php }
July 1, 2017 at 2:43 pm #342597Abdul Rehman
I did not get the process. Can you please explain it in more detial?
July 1, 2017 at 2:50 pm #342600Leo
StaffCustomer SupportIn your original post, you mentioned that the setting cannot be switched since you are using navigation logo in primary navigation.
So the method above adds a navigation logo to secondary navigation so you can switch the setting.
Let me know if this makes sense.
July 1, 2017 at 2:54 pm #342601Abdul Rehman
I understood this part. I just don’t know how to use the hooks. Where to insert the code etc
July 1, 2017 at 2:56 pm #342603Abdul Rehman
When I go to the hooks section, there are lots of windows. In which window should I insert the code?
July 1, 2017 at 2:58 pm #342604Abdul Rehman
I am already using this CSS. Shall I remove it?
.site-header {
display: none;
}.main-navigation .sticky-logo,
.main-navigation .sticky-logo img {
width: auto;
}/* Navigation logo */
.main-navigation .sticky-logo,
.main-navigation .sticky-logo img {
height: 55px;
}.main-navigation .navigation-logo {
padding-left: 70px;}
.main-navigation
padding-top: 100px;July 1, 2017 at 3:00 pm #342605Leo
StaffCustomer SupportThat hook is actually not in the hooks module so add it as a snippet: https://docs.generatepress.com/article/adding-php/#code-snippets
You can keep that CSS for now. Might help adjusting the CSS once you add the logo into the secondary navigation.
July 1, 2017 at 3:09 pm #342611Abdul Rehman
Ok. I added code in functions.php file in my child theme. But I can’t see any new hook category in hooks section.
July 1, 2017 at 4:19 pm #342622Abdul Rehman
What should I do next?
July 1, 2017 at 7:37 pm #342653Leo
StaffCustomer SupportThe code acts as the hook. If you replace URL TO NAVIGATION LOGO by the actual URL then it should show up.
July 1, 2017 at 7:50 pm #342654Abdul Rehman
actual URL here means?
July 1, 2017 at 7:52 pm #342655Leo
StaffCustomer SupportURL of your logo image.
July 1, 2017 at 7:57 pm #342656Abdul Rehman
I put the URL of logo image. Still no new category visible in the hooks. By what name does new category appear?
July 1, 2017 at 8:01 pm #342657Abdul Rehman
I am already using this function
add_filter( ‘generate_logo_href’,’generate_custom_logo_href’ );
function generate_custom_logo_href()
{
// Enter the URL you want your logo to link to below
return ‘http://www.elearnee.com’;
}Is this code interfering?
-
AuthorPosts
- You must be logged in to reply to this topic.