-
AuthorPosts
-
November 2, 2020 at 2:46 pm #28775ChrisGuest
We are using the BoldGrid Linx Theme and like it very much, however it uses hard-coded backgrounds which overlay images from the theme automatically. This has become quite an inconvenience for us.
We deleted the files from wp-content in the theme and it temporarily solved the problem, but of course they come back each time the theme is updated. We do not want to have to delete these files every time an update occurs.
This appears to be a bug. After researching the issue in your support forums, it is seen that several people have been asking for assistance with this particular issue over the past couple of years. Your support response to these inquiries has acknowledged the bug and promised a fix, but that was 2 years ago. We are hoping it will be possible to have a fresh look and escalate this request for the Linx theme.
These are the background files that we need to delete each time there is an update:
background.jpg
concrete_seamless.png
concrete_seamless2.png
shadow.pngPlease do not think we are being disgruntled. BoldGrid is our favorite go-to option for WordPress and we appreciate having such a great set of tools.
Thanks,
ChrisNovember 2, 2020 at 4:14 pm #28789Jesse OwensKeymasterHi Chris-
You can avoid the need to delete those on every update with a little bit of custom CSS. Navigate to Customize > Advanced > Custom JS & CSS and paste these two CSS rules into your Custom Theme CSS:
body.custom-background, .page-template-page_home .entry-content, .site-content, .site-footer { background-image: none !important; } .entry-title { background: none !important; }
November 3, 2020 at 5:45 pm #28810ChrisGuestThank you so much Jessie for the quick reply to my inquiry.
I set up a clean staging site and tried your CSS code with the Linx theme. It does work to eliminate the appearance of the ‘shadow.png’ and the ‘concrete_seamless.png’ on the front end of the website. However, both images are still alive and well in the admin back-end.
Any time one tries to make a new page, post, or block these images still insert themselves. I have tried some CSS as a work-around for this, but have not hit on the right combination.
Do you have some code that might override these images in the admin area?
Best,
ChrisNovember 3, 2020 at 6:46 pm #28816Jesse OwensKeymasterHi Chris-
You’re right, that doesn’t cover the editor. In fact, while I was trying to answer this question for you, I found out that Custom Theme CSS doesn’t apply to the editor at all, so I’ve filed a feature request to add that functionality (as well as an issue for the Linx theme’s backgrounds).
Here’s how I solved this so you can use these steps in the meantime.
First, I installed the plugin Code Snippets and activated it.
Then, I created a new snippet for our custom function to include your Custom Theme CSS in the editor. It’s based on this example from WordPress.org. Paste this code into a new snippet:
function bgsc_tinymce_custom_css( $mceInit ) { $custom_styles = preg_replace( "/\r|\n/", "", get_theme_mod( 'custom_theme_css' ) ); if ( isset( $mceInit['content_style'] ) ) { $mceInit['content_style'] .= ' ' . $custom_styles . ' '; } else { $mceInit['content_style'] = $custom_styles. ' '; } return $mceInit; } add_filter('tiny_mce_before_init', 'bgsc_tinymce_custom_css' );
When you first save your snippet, I strongly urge you to select the option to Only run once. That way, if any typos have been made, your site will only crash once, and you can reload the page and your site will be fine.
If you don’t get an error when you save it once, go ahead and set it to Only run in administration area.
Finally, modify your original Custom CSS to add the editor style mce-content-body:
body.custom-background, .page-template-page_home .entry-content, .site-content, .site-footer, .mce-content-body { background-image: none !important; } .entry-title { background: none !important; }
I’m really sorry this has been such a complicated issue for you Chris, and I’m going to bug the developers to fix this issue once and for all in the Linx theme. In the meantime, I hope these steps resolve the issue for you.
- This reply was modified 4 years ago by Jesse Owens.
November 5, 2020 at 9:43 am #28862ChrisGuestWow, you have really gone the extra mile Jesse. Your thoughtful help and the fact that you have escalated the issue is so much appreciated.
Here is the result of my experiment with your latest code:
In my newly created BoldGrid staging site, I installed the ‘Code Snippets’ plugin, pasted the PHP code you sent into a new snippet, and activated it to run in the admin area. I then pasted your latest CSS styles into the custom CSS editor.
To test, I created a new page within the BoldGrid editor, but sad to report that the PHP did not work to eradicate the hard-coded backgrounds in the admin area. However, as before, the CSS did work to defeat them on the front end. But hey, it was a good try.
We will stand by for now and just continue to delete the background files when we update the theme. Hopefully, your request for a fix will happen in the near future. A solution for this sticky background issue will help not only myself, but many others going forward. Once again, thanks a million for your efforts.
Best,
Chris -
AuthorPosts
- The topic ‘Hardcoded Background Images — Linx Theme’ is closed to new replies.