Craig1986
Forum Replies Created
-
Problem resolved!
Whilst I unchecked the ‘Print CSS’ for the Slideshows that are being used, the CSS Files were still being produced as I still had ‘Print CSS’ checked for the unused Slideshows.
After unchecking ‘Print CSS’, for the ‘unused’ Slideshows as well, the problem was resolved.
Thanks for your time!
After experimenting somewhat, I have found the following:
The only way I can seem to entirely remove all remaining CSS Files, is by removing the following code from
/wp-content/plugins/ml-slider/inc/slider/metaslider.class.css
:public function enqueue_scripts() { if ('true' == $this->get_setting('printJs')) { $handle = 'metaslider-' . $this->get_setting('type') . '-slider'; wp_enqueue_script($handle, METASLIDER_ASSETS_URL . $this->js_path, array('jquery'), METASLIDER_VERSION); $this->wp_add_inline_script($handle, $this->get_inline_javascript()); } if ( $this->get_setting( 'printCss' ) == 'true' ) { // this will be added to the bottom of the page as <head> has already been processed by WordPress. // For HTML5 compatibility, use a minification plugin to move the CSS to the <head> wp_enqueue_style( 'metaslider-' . $this->get_setting( 'type' ) . '-slider', METASLIDER_ASSETS_URL . $this->css_path, false, METASLIDER_VERSION ); wp_enqueue_style( 'metaslider-public', METASLIDER_ASSETS_URL . 'metaslider/public.css', false, METASLIDER_VERSION ); } do_action( 'metaslider_register_public_styles' ); }
By removing the above code, in its entirety, it also removes the
.js
files. Something I do not wish to do. Adopting the ‘method of elimination’ approach, to find out which code snippet was responsible for the CSS Files, I solely removed:if ('true' == $this->get_setting('printJs')) { $handle = 'metaslider-' . $this->get_setting('type') . '-slider'; wp_enqueue_script($handle, METASLIDER_ASSETS_URL . $this->js_path, array('jquery'), METASLIDER_VERSION); $this->wp_add_inline_script($handle, $this->get_inline_javascript()); }
This did not remove anything.
I then solely removed:
if ( $this->get_setting( 'printCss' ) == 'true' ) { // this will be added to the bottom of the page as <head> has already been processed by WordPress. // For HTML5 compatibility, use a minification plugin to move the CSS to the <head> wp_enqueue_style( 'metaslider-' . $this->get_setting( 'type' ) . '-slider', METASLIDER_ASSETS_URL . $this->css_path, false, METASLIDER_VERSION ); wp_enqueue_style( 'metaslider-public', METASLIDER_ASSETS_URL . 'metaslider/public.css', false, METASLIDER_VERSION ); }
Upon removing the above snippet, all remaining CSS Files were removed apart from:
/wp-content/plugins/ml-slider/assets/sliders/nivoslider/themes/default/default.css?ver=3.10.3
Any ideas on how to resolve this matter? Once the relevant code snippet has been identified, what would be the best approach to remove dequeue the snipper within the
functions.php
file? I have tried many approaches but cannot seem to remove the remaining CSS Files.The remaining URL/CSS Files are as follows:
/wp-content/plugins/ml-slider/assets/sliders/nivoslider/nivo-slider.css?ver=3.10.3 /wp-content/plugins/ml-slider/assets/metaslider/public.css?ver=3.10.3 wp-content/plugins/ml-slider/assets/sliders/nivoslider/themes/default/default.css?ver=3.10.3
Thanks for your quick reply. Whilst the ‘Advanced > Print CSS’ option removes one of the CSS Files, all of the others remain.
Are you able to advise on a suitable Hook, to remove all CSS Files? I have tried many of the Hooks but it does not seem to work.
Forum: Plugins
In reply to: [WooCommerce] Is a WooCommerce Product Page, a Custom WordPress Post?Ok, great. Thank you for your answer. ??
Thanks for your input. I have just gone through my
functions.php
file and noticed I inserted the following code twice:<?php function remove_menus(){ // If the current user is not an admin if ( !current_user_can('manage_options') ) { remove_menu_page( 'woocommerce' ); } } add_action( 'admin_menu', 'remove_menus' ); ?>
I removed the first entry but completely oversaw I had it inserted further down in the
function.php
also. Issue resolved, now.Thanks for your time and effort.
Forum: Plugins
In reply to: [WooCommerce] Cannot Save an empty CheckboxThanks for getting back to me.
I have managed to resolve the issue, now. ??Forum: Fixing WordPress
In reply to: How can I create a Custom Text Box on a WooCommerce Product Page?Ok. Thank you. ??
For anyone looking for answer, similar to my questions, please refer to this link:
https://www.ads-software.com/support/topic/how-can-i-create-a-custom-text-box-on-a-woocommerce-product-page-2/Moderator Note: If any Moderators see this, could they delete this post please as it is a duplicate of my other post within the WooCommerce Support Forum area.
- This reply was modified 7 years, 6 months ago by Craig1986.
Thanks Steve! ??
Thank you for the URLs. Especially, the one regarding the Template Hierarchies. Just to clarify then, it is possible to create the Blog Post Formats within the single-gallery.php etc files but it would not be good practice since it may conflict with the Template Hierarchies etc?
Thanks, once again, for your timely response.
Forum: Themes and Templates
In reply to: How can I change folder priorities?Hi Michael,
Thank you for your response. Would this code be within the functions.php file?
Regards
Craig
Forum: Fixing WordPress
In reply to: Trouble Uploading ImagesHi Jackie,
Apologies for the late response. As further troubleshooting, I thought I would make a backup of my database & webfiles and simply rebuild my VPS. I thought that there may be a server related issue but after resetting everything back to its default settings, I am still none the wiser as to what is causing the issue.
I try to limit the amount of plugins I use, for both security and performance reasons. At present, I use the following:
Contact Form 7
Custom Permalinks
Yoast SEO
Core (This is a plugin which came with my theme as to allow theme specific functionality)As a side note, I did delete my plugins but still had the issue.
Have you ever come across something like this before?
As ever, thank you for your time with my issue. It is appreciated.
Regards
Craig
Forum: Fixing WordPress
In reply to: Trouble Uploading ImagesHi Jackie,
Thansk for your welcome and suggestion of going through my Error Logs. Unfortunately, that is something I have already done but nothing unusual stood out. ?? define
I set the wp_debug to true as follows: (‘WP_DEBUG’, true); and then tried to upload the image. Again, to no success. Like before, if I shortened the file name to just one word, it would upload.I am not sure if this would affect anything but I modified the following values in my ‘php.ini’ file as follows:
memory_limit 256m
post _max_size 16m
upload_max_filesize 4mWould changing these values have any affect on my issue? I have never come across such an issue like this before.
Thank you for your suggestion on becoming a volunteer in the WordPress community. I am self taught (and still learning) with the WordPress platform together with learning new aspects about VPS Servers every day. I am by no means an expert but I have learnt a lot during my own journey and once I am fully setup on my latest project, I would be happy to answer a few topics each week, so that those with greater product knowledge, can spend their time answering the more complex topics.
Once again, thank you for your time with my query.
Regards
Craig
Forum: Fixing WordPress
In reply to: Problem Uploading ImagesHello,
Sorry to pop by again.
After optimising my VPS, I have managed to get my RAM usage down to under 400MB. I still have 600+MB available but I am still having problems uploading my images. The image itself is only 59KB in size, so surely it cannot be the size of the image. Could there possible be a restriction on image dimensions with WordPress? I have never heard of this before but thought this may be a possibility as I am able to upload images with smaller dimensions but which are larger in file size.
I do not know if this has an impact but I have modified the following variables as follows:
memory_limit 128m
post _max_size 8m
upload_max_filesize 2mSage has been great is highlighting the fact I should consider reducing my RAM usage or upgrading my VPS package. If anyone else is able to point me in any directions as to why I am having such difficulties, that would be great.
As a side note, there is no mention of any errors in my error logs neither.
Regards
Craig
Forum: Fixing WordPress
In reply to: Multi-PHP VersionsThank you.