Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Ryan Hellyer

    (@ryanhellyer)

    Eek, that’s going to be a bit tricky I think.

    You would need to use JavaScript to specifically disable it for that one image. I don’t know of an easy way to do that though unfortunately.

    Thread Starter Frank Gomez

    (@frank6tg)

    Thanks, I didn’t find an javascript with super clear instructions so I used “Options Optimizer,” a great tool.

    Thread Starter Frank Gomez

    (@frank6tg)

    I figured out a better way.
    Options Optimizer worked inconsistently.

    If you want to disable colorbox on a page I used the plugin Per Page Add to Head and hacked some code to get this. Works perfectly.

    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
    <script>
    $(document).ready(function(){
      $("a").click(function(){
        $("a").removeClass("cboxElement");
      });
    });
    </script>
    Plugin Author Ryan Hellyer

    (@ryanhellyer)

    Thanks for reporting back with a solution ??

    Your method will be loading jQuery twice on the same page. You probably found you needed to do that due to the one bundled with WordPress using non-conflict mode. You can work around that by removing the call to a fresh copy of jQuery and wrapping the code like this:

    <script>
    jQuery(document).ready(function($) {
    	$("a").click(function(){
    		$("a").removeClass("cboxElement");
    	});
    });
    </script>

    I haven’t tested that ^. So if it doesn’t work, then I may have made a syntax error.

    Thread Starter Frank Gomez

    (@frank6tg)

    Thank you, My Javascript isn’t that strong so you really helped me out. I knew I shouldn’t have to “call” the ajax file but it didn’t work without it so your edit took care of it.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Disable or Override simple colorbox for 1 image’ is closed to new replies.