How can I permanently fix an issue caused by a wordpress plugin? - wordpress

I am using the plugin Photo Gallery on my WP site and have a CSS issue with it. Before the gallery is displayed correctly, it is displayed for a split second in a different way.
From what I found out, this is apparently a "FOUC" (Flash of unstyled content) and caused by the plugin's CSS file being loaded too late.
Now I was able to fix it by adding a CSS class (.invisible) to the whole gallery in the plugins php code and setting that class in the wordpress style.css to "display: none;".
In my themes JS I then check if there is a photo gallery on the page and once the according CSS file is loaded, I remove the .invisible class from the gallery, so it is displayed correctly.
I am aware that this is not really a good solution, as the next plugin update will break it.
So my question is: What is a better way to fix an issue like this?

Probably the best bet would be to reach out in the support forums and let the plugin authors know that there is a problem. You already have a working fix for that problem so don't hestitate to show them your solution (but i dont think that hiding the slider is a good solution).
All plugins in the WordPress plugin repository have a support forum on wordpress.org … many plugins also have own websites with some kind of support mechanism (forum, contact form …).
Another solution would be to place the code that fixes the plugin not in the plugin folder itself but in you theme/child theme or a own plugin …

Related

Swiper JS for wordpress

as I already found great help here in the community, I thought I'd post my question here, maybe there'd be somebody who could help me.
I am creating my websites in wordpress and found a great tool for creating an image carousel. As I am more of an intermediate in wordpress and mainly working with plugins, I found the swiper JS plugin in the wordpress plugin directory. It works fine but I have the problem that it won't loop and you can't get to the first and last image of the carousel, it always snaps back to the second and second to last image.
https://wordpress.org/plugins/swiper-js-slider/
This is the one I am using right now.
My question also is how I can use the Swiper JS in wordpress without using the plugin. I want to have it specifically on one page and it should be mobile friendly. All the design that already is on the page should be remain as it is. Would there be a possibility to include the Swiper Js tool even though I am using a wordpress theme?
Thank you so so much, it is really hugely appreciated!
Linda
Only worked with the plugin so far, no css helped...
Using WP custom code.
We assume your words "the plugin" are about that exact SwiperJS plugin.
Have you considered using an iFrame? See lower web links.
An iframe will allow you to add a video, audio, images, etc., so presumably even a slider lands in that category. Try this avenue first to see if it works for your needs. Read about WP iframe use in the links below.
<iframe src="test7.html" width="600" height="300" style="border:1px solid black;" title=""></iframe>
Or...
Other snippet plugin options exist (read developer docs). There are pro/con to some of those options (i.e. time, etc). Read developer resources (from an WP admin perspective) for more ideas.
wordpress iframe
kinsta article
WP developers articles

Search plugin breaking parts of theme

I've been asked to add a search function to a website. I'm trying this out on a testing site at http://www.somethingchronic.org.uk (the password to view is Entrand0s1).
I've installed a search plugin which works on all pages except the home page. On that page it clashes with the script in the slider plugin and when I tried deactivating the slider plugin I also lost the four large buttons at the bottom of the page which are part of the theme itself. Both the slider plugin and the theme are old but I'm hoping to keep the site going for a little while longer if I can. I asked for advice from the search plugin developer who said it's to do with the slider loading an older version of the jQuery library. I searched on here for jQuery library conflicts - one answer linked to the learn.jquery website with a list of options for avoiding library conflicts. There were a number of options for adding code - I tried adding some of these to the header.php document but each time the site broke completely and truth is I don't know enough about jQuery to know which is the correct piece of code to try. Any advice appreciated - would be great to know if there is a way to get the search plugin to also work on the home page whilst keeping the current slider. Many thanks

Can't select image for site identity logo in Customizer menu

When I select the image I want, this is the screen I get.
blank media library menu
I'm thinking a plugin I have installed is effecting this. Got any ideas?
How many plugins you've got in your installation?
The most common reasons your Media Library has stopped working properly are incompatible plugins and/or themes and improperly set file permissions. Fortunately, they can likely be resolved simply and quickly.
First, I recommend you test out your plugins. Navigate to Plugins > Installed Plugins within WordPress. Select the top checkbox next to Plugin (to select all plugins) and choose Deactivate from the Bulk Actions drop-down menu. Click Apply, then return to your Media Library.
If it loads, one of your plugins is the issue. Unfortunately, there’s no easy way to tell which one. You’ll have to reactivate each plugin individually and check your Media Library each time. Once the library stops loading again, the plugin you’ve just activated is the problem. More of this information can be found here.

Buddypress - Adding friends breaks layout

I am pretty new to Buddypress (this is my first install) and not so new to WP. I have a custom theme with Buddypress installed and all works great with the exception of adding/canceling friend requests. Whenever someone hits Add/Cancel Friend then for some reason it breaks the layout of the page by displaying what looks like a iframe of our site.
I have looked around the forums and google to see if I maybe forgot to add something in my theme but cant get it right.
The only way I have been able to (temporarily) fix this is by display:none on the .pending_friend selector but I know it will still display in the markup and is not the best solution.
Has anyone encountered this yet, or can suggest a fix? I feel like it is probably something really simple and my over complicated thought process just isnt seeing it.
Attached is a screen shot of what happens when you add/cancel friends??
Help
Found out the starter theme I was using had deregistered the default version of JQuery to load its own, so after troubleshooting I just removed their call to deregister and enqueue scripts and just let Wordpress do its thing, all is working perfectly now.

How do I load same css and scripts as dashboard, in my wordpress plugin

I have googled this and looked across this site and for the life of me cannot find an answer,
I am writing a plugin for wordpress and when I log into the dashboard I can see a collapsable div with content all styled nicely.
When I open my plugin page I don't see the same styles even though the page is very basic.
I have copied the code from the dashboard but it seems as though some of the styles are missing.
I do not need to add custom styles or scripts I just want to load the same css as the dashboard page.
Can anyone tell me where I am going wrong? I assume that the plugin page will adopt the standard admin css, is this assumption wrong?
You don't have to load anything extra for this, just use the correct classes.
You can either look these up in the source, or by using resources as this:
http://www.onextrapixel.com/2009/07/01/how-to-design-and-style-your-wordpress-plugin-admin-panel/

Resources