Normally I’d suggest reaching out to theme support, but it sounds like you may be the theme support.
This is likely much more an issue with how the page is being created and more specifically something to do with some javascript being implemented. It very much feels like some JS somewhere is preventing the default click handling, and potentially across more of the page than intended. However, I’m not managing to determine what, from my quick poking around with my browser dev tools.
We don’t directly interact with the frontend and the themes with CPTUI itself, what we would be doing is merely getting the post types and taxonomies registered as appropriate.
Thread Starter
gerg1
(@gerg1)
What would you suggest for trying to debug this issue?
Not sure how live the site is, but i’d start by commenting out any javascript file loading/enqueuing till the issue goes away, and then slowly re-add each, refreshing after each one, until the issue comes back.
Not sure if it’d be feasible, possible, or potentially helpful to temporarily switch themes, but that may at least confirm it’s coming from the theme itself.
Thread Starter
gerg1
(@gerg1)
We found that this script was causing the Nav menu / links to break:
<!-- SCRIPT BREAKING NAV
<script>
jQuery( document ).ready(function($) {
/* Basic Gallery */
/* $( '.swipebox-custom' ).click(function(e){
e.preventDefault();
var gallery = [];
$( '.swipebox-custom' ).each(function(){
var imageobj = new Object();
imageobj.href = $(this).attr('data-href');
imageobj.title = $(this).attr('title');
gallery.push( imageobj);
});
$.swipebox( gallery );
}); */
$( '.swipebox-custom' ).swipebox();
$( '.box-modal' ).click(function(){
var id = $(this).attr( 'data-id' );
$( '#'+id ).show();
return false;
});
$('.hover_bkgr_fricc').click(function(){
$('.hover_bkgr_fricc').hide();
});
$('.popupCloseButton').click(function(){
$('.hover_bkgr_fricc').hide();
});
//$( '.swipebox-custom' ).swipebox();
});
</script>
-->
Disabling the script stops the swatches at the bottom of the page to not pop up anymore
Good find, but doesn’t necessarily help get things resolved and workable for everything. Not sure what to suggest regarding getting around that and still retaining use of the lightbox functionality.
Thread Starter
gerg1
(@gerg1)
I don’t know too much javascript to try and debug the code, but this section `$( ‘.swipebox-custom’ ).click(function(e){
e.preventDefault();
var gallery = [];
$( ‘.swipebox-custom’ ).each(function(){
var imageobj = new Object();
imageobj.href = $(this).attr(‘data-href’);
imageobj.title = $(this).attr(‘title’);
gallery.push( imageobj);
});
$.swipebox( gallery );
});`
Seems to be the main cause. commenting it out, lets links work again but the popup feature doesn’t
Is this a spot that was inherited when you were brought in for this client? or is it something done custom since you started? Trying to determine who you could potentially reach out to regarding it.
From what I know, it’s trying to gather up all the items with the “swipebox-custom” class, and create new objects out of it, assigning each box’s data-href attribute and the title, before pushing into this gallery plugin.
I just don’t have a good solution to get around this.
Thread Starter
gerg1
(@gerg1)
Our company didn’t build the website. As far as I’m aware the function was working when we acquired this website.
Hmm. Good to know, but also doesn’t bring me anything new to suggest regarding the issue overall.
Thread Starter
gerg1
(@gerg1)
I just tested the code again without commenting anything out and links work still but the popup feature doesnt.
Thread Starter
gerg1
(@gerg1)
Correction. We’ve been testing majority of this issue on a copy of the website on our server. The live website is on another server. If I keep the script normal with no commenting out on the test site, Nav menu/links work but not the popup feature.
If I do the same thing on the live site, If I comment out certain sections of the script: the nav/links are still broken, the info popup works but not the image expand popup
If comment the whole script out: nav/links work, neither popup works
Wish I had more to contribute here, but this is essentially a theme/theme functionality issue more than anything with CPTUI at the moment.