Archived topic
Navigation Logo Not Displaying on Some Pages
12 replies · Started by Paul on March 6, 2017
Weird problem. I'm using GP + GP Premium (latest) with iHomefinder's Optima IDX plugin. On all pages that are NOT related/tied to the plugin (Home, Contact, Blog, About), the Navigation logo displays just fine. However, on the Optima IDX pages (Featured Listings, Property Search and search result pages, Email Alerts), the navigation logo does not display. Only the image's ALT text displays.
Looking at the source code on the pages with NO logo displaying I see:
<img class="header-image" src="" alt="My Alt Text">
SRC is empty!
Contrast to the pages WITH a working logo, and the source code is:
<img class="header-image" src="https://example.com/wp-content/uploads/my-navigation-logo-image.png" alt="My Alt Text">
What could be causing the URL to the logo image to be dropped?
I looked at the source code in the theme's template-tags.php file and see variables are being used:
<img class="header-image" src="%3$s" alt="%2$s" title="%2$s" />
Somehow the variable is not being passed thru?
Hi Paul,
Can you provide a link to your site where it's not working?
Here it is: https://nevadacounty.property/
Huh, well that's really weird.
Are you using the generate_navigation_logo filter or overwriting the navigation logo using the Page Header add-on anywhere?
I double-checked, Tom, and no on both.
Further, I can't even edit the IDX pages using the page editor, so it's not possible to modify the Page Header add-on settings on per-page basis for these plugin-generated pages.
I'm really stumped by how the img URL is gone, but not the alt text on these pages.
I'm pretty stumped as well.
The function that adds the navigation logo checks to see if the URL is empty - if it is, it won't print any of the logo HTML.
So in this case, the function knows a URL exists, prints the HTML, yet the actual URL is never printed.
The URL is filtered, which is why I mentioned the filter above.
Other than that, I can't think of any logical reasoning at all unless the plugin you're using is:
a) rewriting URLs somehow in a way that affects the navigation logo URL
b) Using JS to alter URLs on the page
Neither seem very likely..
Is this a premium plugin or a free one?
Optima Power Agent is a paid plugin (~ $50/mo). I've contacted their support team too to ask if they can figure it out.
The only thing I can think of that affects URLs is the HTTP / HTTPS Remover Plugin ( https://wordpress.org/plugins/http-https-remover/ ). Reason I used this was because Regex couldn't find/replace all instances of http: in the site's code (after I migrated site from localhost to Https on web server), causing the browser to report mixed content warnings. However, I originally did deactivate all other plugins off except GP Premium and Optima to test and the logo was still not showing.
The other weird thing too is that I when I initially built the site, I was using Optima's 30 day free trial. Once the trial ran out, the logo disappeared on all of the IDX pages along with all the real estate listings and other Optima features. I figured that once I migrated the site from localhost to a live web server and then paying for the plugin, everything would come back -- well, everything did come back, except the logo.
I am passing this forum thread on to Optima support to see if any of these comments here will be helpful on their end. If you can think of anything else Tom, let me know.
Cheers!
Tom, I just had an idea. Is there any way I could hardcode the logo URL into <img class="header-image" src="%3$s" alt="%2$s" title="%2$s" /> in template-tags.php for just the Optima IDX pages?
The navigation logo is actually in the Menu Plus add-on.
However, it will be possible to filter the navigation logo in the upcoming version, which I'm actually sending out to beta testers right now.
Feel free to email me if you'd like to test the beta versions.
Just for reference, as of GP Premium 1.2.95, you can change the markup of the navigation logo like this:
add_filter( 'generate_navigation_logo_output','tu_change_navigation_logo_output' );
function tu_change_navigation_logo_output( $output ) {
return sprintf(
'<div class="site-logo sticky-logo navigation-logo">
<a href="%1$s" title="%2$s" rel="home">
<img class="header-image" src="%3$s" alt="%4$s" />
</a>
</div>',
esc_url( apply_filters( 'generate_logo_href' , home_url( '/' ) ) ),
esc_attr( apply_filters( 'generate_logo_title', get_bloginfo( 'name', 'display' ) ) ),
'YOUR LOGO URL',
esc_attr( apply_filters( 'generate_logo_title', get_bloginfo( 'name', 'display' ) ) )
);
}
Ooooh! Thanks for that code Tom. I'll try that and let you know if it works out.
It won't work before GP Premium 1.2.95.
Dude... Tom, you are a freakin' genius! This totally worked.
Thanks so much. Marking as resolved.
Filters are awesome :)
Glad I could help!