- This topic has 12 replies, 3 voices, and was last updated 7 years, 1 month ago by Tom.
-
AuthorPosts
-
March 6, 2017 at 5:37 pm #287985Paul
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?
March 6, 2017 at 5:53 pm #287993LeoStaffCustomer SupportHi Paul,
Can you provide a link to your site where it’s not working?
March 6, 2017 at 8:25 pm #288048PaulHere it is: https://nevadacounty.property/
March 6, 2017 at 8:58 pm #288064TomLead DeveloperLead DeveloperHuh, 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?March 6, 2017 at 9:47 pm #288074PaulI 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.
March 6, 2017 at 10:33 pm #288080TomLead DeveloperLead DeveloperI’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 pageNeither seem very likely..
Is this a premium plugin or a free one?
March 7, 2017 at 8:12 am #288320PaulOptima 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!
March 7, 2017 at 12:58 pm #288447PaulTom, 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?March 7, 2017 at 2:01 pm #288489TomLead DeveloperLead DeveloperThe 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' ) ) ) ); }
March 7, 2017 at 7:11 pm #288594PaulOoooh! Thanks for that code Tom. I’ll try that and let you know if it works out.
March 7, 2017 at 7:44 pm #288596TomLead DeveloperLead DeveloperIt won’t work before GP Premium 1.2.95.
March 8, 2017 at 10:52 am #288951PaulDude… Tom, you are a freakin’ genius! This totally worked.
Thanks so much. Marking as resolved.
March 8, 2017 at 12:33 pm #288988TomLead DeveloperLead DeveloperFilters are awesome 🙂
Glad I could help!
-
AuthorPosts
- You must be logged in to reply to this topic.