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

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/

Related

swiper.js is redirecting my lightbox to the original media URL

The swiper.min.js file that was part of my WordPress them is not allowing any lightbox related plugins on my website to load. When you click on it, you can see the lightbox arrows for a split second, then it redirects to the original media URL. Can someone pinpoint what it is in the swiper.js file that is making this happen. That way I can remove it. I would so appreciate it. I've been spending days trying to figure out what the issue is, and I've finally at least pin pointed that it's coming from swiper.min.js.
Website link where lightbox plugin is used: https://smithspecialized.com/edmonton-drawworks/
I tried removing some things in the file that I thought had something to do with the lightbox redirecting to media URL, but then it broke the code so I think I removed too much, or the incorrect section in the code.
Hey there it's difficult to find any error without accessing website from inside. If don't want to give access then-
please use different plugin or
try to disable and enable plugin, as sometime confliction between plugin caused the issue.

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

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 …

Link blocks to composer in Concrete5

I'm just playing about with an offline copy of Concrete5 and was wondering if there is any way to link blocks to the composer system to make them work? I made a page template hoping I could just click 'new page' and select my template to add it to the right area of my test site, but it won't show up. I then tried to edit a preset page template from my theme, and that worked fine... except it still populates the new page with the original blocks.
It seems like a total nightmare to do anything in this system. Should I be using a different one if I can't even do this?
I am not sure I fully understand your question but have you had a look at this tutorial? It might help https://documentation.concrete5.org/tutorials/setup-a-simple-blog-within-concrete-5-7

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 hide WordPress from my source code?

Can I hide the code of html + javascript of wordpress pages ?
I mean when anyone hits view source he/she will not able to know that the website was developed using WordPress ?
It is not possible to prevent a user from viewing the source of a website. The web browser needs to be able to render it, so any form of "encryption" would cause the browser to miss-render the page.
There are HTML obfuscation tools online such as this. But you would not be able to use them in WordPress as it generates all it's HTML on the fly.
Rather than hiding the fact that you are using WordPress I would suggest that you ensure your WP install is kept up-to date and that you use sensible security plugins such as Bulletproof Security.
If you simply want to remove the <meta name="generator" content="WordPress 3.4.1" /> tag from your generated HTML, you can add this in your theme's functions.php.
remove_action('wp_head', 'wp_generator');
If you want to remove the "Powered by WordPress" in the footer text, that'll depend the theme you're using. Some themes allow you to customize the footer text from the dashboard, others will need manual modifications in the footer.php.
It will probably still be obvious that you're using WordPress though. A lot of references to uploaded files inside wp-content will be visible and many class names will have the wp- prefix. You probably won't be able to change those without breaking your website.
In general, you can't stop users from viewing the source of your website. The HTML is what defines the markup and content of your website, and the browser simply renders it. The best you can do is obfuscate it in such way that you can't easily tell what each HTML element represents or what each JavaScript function does.
No it's not possible. It'll will always be possible to see it since the browser has to get it in plain text to render it.
Look at JavaScript obfuscation to make your code harder to reuse or understand : How can I obfuscate (protect) JavaScript?
I believe what you're trying to do is hide the fact that your site is powered by WordPress. For that, you can try the suggestions presented here:
How to Hide WordPress Info from Your Source Code

Resources