Archived topic
Hover makes site title vanish with filtered URL
11 replies · Started by Jim on August 13, 2021
I managed to figure out how to filter the URL the header points to, using generate_site_title_href. I do this only for a custom page type on my site.
Normally, when I mouse over the header text, it blinks very briefly. But on the custom page type, only when filtering, hovering makes it completely disappear. It's the strangest thing! But not the most serious problem ever.
Here's the filtering I'm doing:
add_filter( 'generate_site_title_href', function() {
if ( is_singular( 'ncpage' ) ) {
return 'https://forestpathology.org/ncfpw/north-central-forest-pest-workshop/';
} } );
Currently the only page where you can see that special effect is https://forestpathology.org/ncfpw/about-ncfpw/
Hi there,
Don't think I'm seeing the issue you are referring to.
Just to confirm, I just need to hover over the title to see the issue?
Actually, that page was published privately before; I just made it public. Now it's disappearing in Safari but not in Firefox.
Hi there,
is there an issue if you disable the Optimization plugin ?
I deactivated WP-Optimize and Autoptimize (which I only use for lazy-loading images), cleared the Safari browser cache, and the site name still disappears on hover.
Hi Jim,
Can you try this:
Go to Customizer > General, choose External File for Dynamic CSS Print Method, and click Regenerate CSS file.
And deselect the Cache dynamic CSS option if you selected it before.
Let me know if it works.
Unfortunately those changes did not affect it (after publishing the customization, clearing Safari caches, optimization plugins still deactivated).
It's got to have something to do with the filtering, as it only happens when I use 'generate_site_title_href'.
Incidentally, I changed the filter to this, as I found I had to return the default URL if not the one for the custom post type. But it still only affects the custom page type, and only on Safari (only checked it and Firefox).
add_filter( 'generate_site_title_href', function() {
if ( is_singular( 'ncpage' ) ) {
return 'https://forestpathology.org/ncfpw/north-central-forest-pest-workshop/';
} else {
return 'https://forestpathology.org/';
} } );
Can you make sure the customizer setting is indeed correct under Colors > Header?
There is no setting Appearance > Customize > Colors > Header. There is
Appearance > Customize > Colors > Blog Post Title and
Appearance > Customize > Colors > Blog Post Title Hover
Both are set to white or close to it (background is very dark).
I don't know what "correct" would mean.
Hi there,
go to Dashboard > Appearance > GeneratePress and enable the Colors Module:
That didn't fix it either. I was able to fix it by setting .main-title a:hover color in the stylesheet. Really strange that it was specific to a custom page type and Safari.
Thanks for the ideas.
I think the reason you are having the issue is because you have these added in your child theme:
.main-title a, .main-title a:visited { color: #ffffff; }
.main-title a:hover { color: #e1e1e1; }
If you remove that, then the customizer options should work.
You can test by activating the parent theme without your own styles.