Archived topic
Site title sticky
24 replies · Started by Flemming on August 28, 2017
Ahh sorry I missed that part.
Let's give this another shot. Add this in hook:
add_action( 'generate_inside_navigation', 'tu_site_title_navigation' );
function tu_site_title_navigation() {
?>
<div class="menu-site-title">
<a href="https://flemmingvestergaard.com/">Flemming Vestergaard</a>
</div>
<?php
}
And this is the CSS:
@media (min-width:769px) {
.menu-site-title {
float: left;
}
}
@media (max-width:768px) {
.menu-site-title {
text-align: center;
}
}
.menu-site-title a {
font-family: "Noto Serif", serif;
font-weight: normal;
font-size: 35px;
color: #464866;
}
Then reduce the top mobile content padding to 0: https://docs.generatepress.com/article/content-padding/
Let me know :)
Tried applying above. When adding the link in php to the site title, I got at smaller site title placed upper left for some reason?
Mobile padding worked fine.
Hmm I'm not seeing the link being added?
I tested the code and CSS on my site. It should work. Make sure you copy and replaced everything.
Please leave it in if it doesn't. I'll find the fix :)
:-)
Link added now
Make sure you use this CSS: https://generatepress.com/forums/topic/site-title-sticky/page/2/#post-376999
The last block didn't update.
Yep, using the CSS below, only font is different from yours
In Simple CSS there is a warning on "min-width" and "max-width" for some strange reason.
@media (min-width:769px) {
.menu-site-title {
float: left;
}
}
@media (max-width:768px) {
.menu-site-title {
text-align: center;
}
}
.menu-site-title {
font-family: "Georgia", serif;
font-weight: normal;
font-size: 35px;
color: #464866;
}
Hi Joe,
Since we had problems getting this to work, I revert to using the GeneratePress etc. settings and wait until you release the version to control all in GeneratePress.
Thanks for trying to help!! :-)
Please pay extra attention to the first line in the third block of code here: https://generatepress.com/forums/topic/site-title-sticky/page/2/#post-376999
I have .menu-site-title a, while you have .menu-site-title. That should be the only reason why it wasn't working.
This is one of those things that should be simple. Why would the site title and tagline disappear when you apply sticky navigation?
Anyway, try the myStickymenu plugin. It works pretty well.
That said, for a premium theme, this should be built into the feature set and not require a plugin or custom code.
We are working on a solution that allows site title and tagline in navigation.
Thanks for your feedback :)