- This topic has 11 replies, 3 voices, and was last updated 7 years ago by Mary Pearson.
-
AuthorPosts
-
April 12, 2017 at 11:00 am #305072Mary Pearson
I have been having several problems with my christiangays.com website lately. The most noticeable is that I’ve lost the colour in my custom CSS files. I did a plugin test and no change, but when I change themes I get the colour back.
I see that I posted before about losing formatting after updating and the problem was my caching plugin so I have de-activated it, but still no colour in the custom CSS.
I also can’t switch from Visual tab to HTML tab but when I change themes I can.
Would appreciate your help.
Thanks!April 12, 2017 at 11:41 am #305095LeoStaffCustomer SupportHi Mary,
I’m not sure what you meant by no color in custom CSS?
GP wouldn’t stop your custom CSS from being read.
I am also seeing a lot of jQuery errors on that site. Looks like a lot of it is coming from buddypress.
Can you try deactivate all non-GP plugins?
Let me know.
April 12, 2017 at 12:57 pm #305145Mary PearsonHi Leo,
I did a complete plugin test before writine, deactivated ALL plugins except GP and Simple Custom CSS. There was still no colour. What I mean by that is that on the CSS page the text is normally
/* grey */
.blue {
black: 1px green solid #blue; }but with GP theme it is all black now.
You have given me a clue though by saying that you see lots of jquery errors. I recently compressed some files. I’ll bet that’s the origin of the problem. I will see what I can find out. Thank you.
April 12, 2017 at 1:00 pm #305147LeoStaffCustomer SupportAny reason you are not using the Editor or GP’s color add-on to change the text color?
That CSS above also doesn’t really make any sense so I don’t think it should work in the first place?
April 12, 2017 at 1:10 pm #305156Mary PearsonI was just trying to give you an example since I can’t see how to send a screenshot. What I mean is that the
information between the /* */ tags is gray
the selectors are blue, example .main-title or .inside-navigation
the items like border, margin, padding, etc are black.
px is in green such as 1px
colours are in blue such as #000099
etc.
So until now I have had these items in colour but now they are black.
April 12, 2017 at 1:19 pm #305161LeoStaffCustomer SupportLike in the in the plugin itself?
Sounds like there is a syntax error somewhere.
April 12, 2017 at 1:23 pm #305162Mary PearsonYes, like when I enter Custom CSS in the back end of the website, the colours are no longer there, but I think you have already given me the answer.
I think it must be from me minifying some of the javascript files. I just haven’t had time to find out which ones yet, but that’s what I’m going to work on now. I will leave the ticket open until I can let you know if/when I find out what the problem is.
Thank you Leo!
April 13, 2017 at 1:14 pm #305593Mary PearsonOK it took some looking but Leo, it was you who gave me guidance of what to look for. I had added the following to my functions.php file.
/*function to add async to all scripts*/
function js_async_attr($tag){# Do not add async to these scripts
$scripts_to_exclude = array(‘https://christiangays.com/mary-content/themes/generatepress_child/js/fish.js’);foreach($scripts_to_exclude as $exclude_script){
if(true == strpos($tag, $exclude_script ) )
return $tag;
}# Add async to all remaining scripts
return str_replace( ‘ src’, ‘ async=”async” src’, $tag );
}
add_filter( ‘script_loader_tag’, ‘js_async_attr’, 10 );When I removed it, voila, the website was back to normal. Can you see my coding error in it? I just copied and pasted from something I found online. I don’t really know what I’m doing.
Thanks!
MaryApril 13, 2017 at 7:53 pm #305700TomLead DeveloperLead DeveloperI don’t see anything wrong really, but it doesn’t look like it should be necessary either.
April 13, 2017 at 7:54 pm #305701Mary PearsonThanks Tom. I was just trying to speed up my website.
April 14, 2017 at 10:03 am #305954TomLead DeveloperLead DeveloperRemoving query strings will help your page speed rankings, but won’t actually improve page speed much 🙂
April 14, 2017 at 10:05 am #305958Mary PearsonThank you Tom!
-
AuthorPosts
- You must be logged in to reply to this topic.