php - Overriding a javascript function in a Wordpress Child Theme -


I am writing a simple Wordpress child theme.

is a portfolio feature that uses FlexSlider to display the thumbnails from the most recent posts and when they click on it, to open the content posted in a single device on this page Uses AJAX.

I've written a category page based on this, which pulls all post categories and shows thumbnails for recent posts. However, when I click on the thumbnail, I need a new page Going on and the content does not open in the devil.

The problem is, I am reusing code which looks a bit like this:

   is_psoz ()): $ my_query-> The_post (); ? & Gt; & Lt; Div class = "flexlider" & gt; & Lt; Ul class = "slide" & gt; & Lt; Li & gt; & Lt; A href = "http: // the-url-here" & gt; & Lt; Img src = "& lt ;? php echo $ ring [0] ;? & gt;" / & Gt; & Lt; / A & gt; & Lt; / Li & gt; & Lt; / Ul & gt; & Lt; / Div & gt; & Lt ;? Php timeline; ? & Gt;  

But the custom JS Basic theme is within the global footer, which normally works to open the content instead of redirecting the location specified in the tag.

  $ (". Flexslider ul.slides li a"). Live ('click', function (e) {e.preventDefault (); / * set the function variable * / $ this = $ (this); $ selected month = $ this; $ postId = $ ($ this) .attr ('Data-url'); // and so on ... return;});  

Therefore, I have to disable javascript associated with .lexslider ul.slides li a , only on that single page template , Preferably without changing classes, as I think another bug will open around CSS. Remember the topic javascript loads in the footer, so I think any changes will be overridden in the imet footer in the page template.

What is the best way to reach it?

Just click the live listener about your child. Add this javascript only to that specific page template.

  $ (". Flexslider ul.slides li a"). Die ('click');  

Comments

Popular posts from this blog

Pass DB Connection parameters to a Kettle a.k.a PDI table Input step dynamically from Excel -

multithreading - PhantomJS-Node in a for Loop -

c++ - MATLAB .m file to .mex file using Matlab Compiler -