- This topic has 11 replies, 2 voices, and was last updated 5 years, 8 months ago by Tom.
-
AuthorPosts
-
August 14, 2018 at 12:35 pm #648212eraserheader
Hi Tom, I LOVE THIS THEME!
First time to come across this tricky situation though: the theme’s entire CSS gets dumped out on one page if a user is not logged in. It is the “Business Member Login” page in the navigation (I’ve notated URL of site in the box for admins here on the forum). If a user is logged in, the theme’s CSS is fine for that page.
Note that this is tied to a directory plugin which I’ve keep activated to troubleshoot, as it is the purpose of the site. If I deactivate the plugin, the CSS stays with GeneratePress.
But when the plugin is activated and I switch to other themes, the CSS also stays. It only drops with GeneratePress.
I have Premium and a child theme installed, but the issue happens the moment I activate GP.
Many thanks in advance!
August 14, 2018 at 7:13 pm #648576TomLead DeveloperLead DeveloperHi there,
Glad you’re enjoying the theme!
I’m not too sure what I’m look for on that page. Any chance you can share a screenshot of what it should look like?
August 15, 2018 at 6:08 am #649099eraserheaderThanks Tom!
How other pages display when users are logged out (or in), you see elements set up by GP (paper texture, fonts, colours). https://drive.google.com/file/d/1QjFDN1ZyAGncIOXlQmI_ynmBnrlh0UVN/view?usp=sharing
How that one page displays when users are logged out (no elements). Note that the same plugin is in use on both pages, but for some reason, GP’s CSS is being dumped. Everything displays fine if you are logged in. https://drive.google.com/file/d/1Pfc9lwyUmUxIvlUWuVtGCGYT_Zd1-ZcU/view?usp=sharing
August 15, 2018 at 9:37 am #649453TomLead DeveloperLead DeveloperHere’s what I’m seeing as a logged out user: http://prntscr.com/kizn8m
Perhaps there’s some sort of caching issue going on?
August 15, 2018 at 9:40 am #649457eraserheaderHi Tom,
That page displays correctly. But click “Business Member Login” (second screenshot I sent) and you’ll see that the page drops CSS.
There isn’t a caching plugin installed.
Thanks!
August 15, 2018 at 10:09 am #649507TomLead DeveloperLead DeveloperSomething is preventing the dynamic CSS from printing to the page.
Any chance you can deactivate your other plugins to rule out a plugin conflict?
August 15, 2018 at 11:35 am #649612eraserheaderAll others are deactivated, except GP Premium and the plugin (made sure to turn them off while I awaited your feedback). There is no caching plugin. There is no conflict with other themes, just GP.
My conversation with the listing plugin developer was the usual: deactivate all other plugins, revert back to TwentySeventeen theme. The only time the CSS gets dumped is when I switch to GP, no matter what plugins are or are not activated. Once we narrowed it down to GP, the plugin developer directed me to you.
Do you know of a solution to inject that missing dynamic CSS for this one page? I would be completely satisfied with such a workaround π
August 15, 2018 at 4:11 pm #649911TomLead DeveloperLead DeveloperIt makes sense that it only happens with GP, as GP adds dynamic CSS to the
<head>
, whereas something like TwentySeventeen doesn’t.Here’s an example of the function we use to add it:
add_action( 'wp_enqueue_scripts', 'generate_enqueue_dynamic_css', 50 ); /** * Enqueue our dynamic CSS. * * @since 2.0 */ function generate_enqueue_dynamic_css() { $css = '.example {color: red;}'; wp_add_inline_style( 'generate-style', $css ); }
So for some reason, that plugin is preventing the above from happening.
Maybe if you show the developer this they’ll have an idea?
August 16, 2018 at 9:19 am #650818eraserheaderThanks Tom, I will see what they have to say about this. Fingers crossed, and thanks for the stellar customer service!
Have you come across any plugins or wording I can use to research how I might be able to pull that CSS and inline it in the event I come up against a wall?
Much appreciated!
August 16, 2018 at 8:00 pm #651327TomLead DeveloperLead DeveloperIt really depends. The best way to do it is how we’re doing it, so we’d need to know why the plugin is preventing that from working to find an alternative that will work.
August 17, 2018 at 12:45 pm #652153eraserheaderThanks Tom! This was the dev’s reply:
“Yes, it is quite clear that the theme adds inline CSS code. But we have to find out why it does not include this required CSS code when we are using one specific shortcode on a page. This is the clue.
This is just an example code to test they gave you. You can place it into functions.php of the theme and look if it will appear in the source code of a page. I tested it with our plugin on the dashboard page and it appears.”
I don’t think we’re going to find a direct solution, so found a workaround for myself, which I’ll share here in case anyone else with GP purchases “Web 2.0 Directory” plugin and finds the CSS gets dumped whenever a page has the [webdirectory-dashboard] shortcode for logged out users:
1) Installed “Theme My Login” to pull usual WP login content in-page
2) Set Theme My Login to redirect existing members to page with [webdirectory-dashboard]
3) Direct new listing members to the submission URL (note that the plugin wants to do this over-the-top submission page. If you want to get straight to user-side listing creation, just hover over the ‘submit’ button and take note of the URL and use that.GP is hands down my fav theme. I recommend it to everyone and this thread is a testament to your willingness to work with us, and I hope my little thread can be of help to others, as I’ve accomplished SO MUCH by going through this forum.
Beer time! π
August 17, 2018 at 6:23 pm #652314TomLead DeveloperLead DeveloperI’m glad you found a workaround! Sorry I couldn’t be more helpful.
Really appreciate you posting your solution – thank you! π
-
AuthorPosts
- You must be logged in to reply to this topic.