Support Forum

Start Upload button not working

82 Answers

New Answer

GE GE
GE
Member

Ok. So I figured it out.

Posting for posterity and for any others using the Customizr theme.

In the class-fire-ressources.php change the following:

****FROM:

      function tc_scripts() {

          wp_enqueue_script( ‘jquery’ );
          wp_enqueue_script( ‘jquery-ui-core’ );
          wp_enqueue_script( ‘bootstrap’ ,TC_BASE_URL . ‘inc/js/bootstrap.min.js’ ,array( ‘jquery’ ),null, $in_footer = true);

****TO:

function tc_scripts() {

          wp_register_script(‘bootstrap’ , TC_BASE_URL . ‘inc/js/bootstrap.min.js’, array( ‘jquery’ ), false, false);
          wp_enqueue_script( ‘bootstrap’ );
          wp_deregister_script(‘jquery-ui-core’);
          wp_register_script( ‘jquery-ui-core’, ‘/wp-includes/js/jquery/ui/jquery.ui.core.min.js’, array(‘bootstrap’), false, false );
          wp_enqueue_script( ‘jquery-ui-core’ );

MP Mr Papa
Mr Papa
Member

yup, that’s it…  thanks for posting as bootstrap usage by themes seems to be growing…  rumors have WP perhaps including bootstrap in core in 3.8…  have to see if that pans out as they should ensure its loaded properly…

GE GE
GE
Member

Well, I was too fast on the draw, I think…

While the old fix seemed to work with everything updated, I later realized it broke the functionality of the expanding circles for featured images found in the Customizr theme.

So the code I posted above isn’t going to work.

But I did figure out that all I needed to do was to make sure bootstrap wasn’t loading in the footer. I simply changed the last setting in the following code from ‘true’ to ‘false’.

****ORIGINAL THEME CODE

wp_enqueue_script( ‘bootstrap’ ,TC_BASE_URL . ‘inc/js/bootstrap.min.js’ ,array( ‘jquery’ ),null, $in_footer = true);

 

****NEW CODE

wp_enqueue_script( ‘bootstrap’ ,TC_BASE_URL . ‘inc/js/bootstrap.min.js’ ,array( ‘jquery’ ),null, $in_footer = false);

 

I’ve tested this now repeatedly in several browsers, logged in and out. Now the upload buttons work AND the feature circles.

Amazing it boils down to something as simple as that. Maybe that will help someone else.

Now to turn on the rest of my plugins and hope nothing else blows up…. stay tuned.

ETA: All plugins on and everything still seems to work.

MP Mr Papa
Mr Papa
Member

should work… but is theme dependent and sp settings dependent…  the real requirement is to get bootstrap loaded before the wp jquery ui… which this appears to do…

some themes load there stuff in the footer… and sp has an option to load our stuff in the footer (or header)…

so yeah, the key is to get bootstrap loaded first…

AR Andy Ritchings
Andy Ritchings
Member

Just thought I’d add to this topic as I was having similar problems…

 

Using Flexform responsive theme, the file upload buttons were showing as text. Add upload worked, but Start didn’t.

 

Long story short, I added the following to my child theme functions.php:

wp_deregister_script ('sf-bootstrap-js');
 wp_register_script('sf-bootstrap-js' , get_template_directory_uri() . '/js/bootstrap.min.js', array( 'jquery' ), false, false);
 wp_enqueue_script( 'sf-bootstrap-js' );
 wp_deregister_script('jquery-ui-core');
 wp_register_script( 'jquery-ui-core', '/wp-includes/js/jquery/ui/jquery.ui.core.min.js', array('sf-bootstrap-js'), false, false );
 wp_enqueue_script( 'jquery-ui-core' );

 

All seens OK on the site now, not found anything that doesn’t act as it should (touch wood…). There may be an easier or more professional way of doing this, but i’ve muddled through with my basic knowledge!

 

 

YS Yellow Swordfish
Yellow Swordfish
Member

excellent. Yes – we have no reports of rearranging bootstrap loading actually having any negative effects.

For anyone else whio needs to do this note that your bootstrap ‘handle’ name may be different as might the location of the script file. But the basic coding sequence above is sound.

Thanks for the contribution…

KB Kevin Bowers
Kevin Bowers
Member

I tried Midget3k code in my functions.php and it didn’t work. I made sure the handle name was correct. I’m having the exact same problem he had. Is there something else I need to do?

 

MP Mr Papa
Mr Papa
Member

same thing – if its the same problem – make sure jquery ui is loaded after bootstrap…  you can check via the browser check source functionality…

KB Kevin Bowers
Kevin Bowers
Member

I got the bootstrap to load before the jquery ui but the buttons still don’t work.

Here is the page so you can see

http://vapersplace.com/forum

YS Yellow Swordfish
Yellow Swordfish
Member

All kinds of odd things here. Both an iFrame AND cloudflare and no normal source being displayed. So not easy for me to look at trhe source code being generated. And as a non-registered user I can;t load up the attachment controls either…

So – did you wipe out the cache after you made changes?

KB Kevin Bowers
Kevin Bowers
Member

Yellow Swordfish said
All kinds of odd things here. Both an iFrame AND cloudflare and no normal source being displayed. So not easy for me to look at trhe source code being generated. And as a non-registered user I can;t load up the attachment controls either…

So – did you wipe out the cache after you made changes?

I do use cloudflare and I did clear the cache after I made the changes. I will pm you the login info I created last time you needed to login when I had an issue.

 

YS Yellow Swordfish
Yellow Swordfish
Member

What tools do you use to look at the page source being generated?

KB Kevin Bowers
Kevin Bowers
Member

Yellow Swordfish said
What tools do you use to look at the page source being generated?

Right click and view page source on firefox

 

YS Yellow Swordfish
Yellow Swordfish
Member

Curious. No matter what I can not get the source to show up in Firefox. But I CAN see it in Chrome! Odd.

OK – I am going to need a little help on this one so – Mr Papa – please…!

two things.

For Mr Papa – is it the actual Bootstrap JS that needs to be first or the Bootstrap CSS? or both?

And for Kevin – doubtful it has any bearing bit are you aware that you are now loading Bootstrap twice?

KB Kevin Bowers
Kevin Bowers
Member

Yellow Swordfish said
Curious. No matter what I can not get the source to show up in Firefox. But I CAN see it in Chrome! Odd.

OK – I am going to need a little help on this one so – Mr Papa – please…!

two things.

For Mr Papa – is it the actual Bootstrap JS that needs to be first or the Bootstrap CSS? or both?

And for Kevin – doubtful it has any bearing bit are you aware that you are now loading Bootstrap twice?

I saw that. The theme is loading it twice. I can take one out if you think that would help.