$('.class1').append( '' );
var button = $('.class1.load-more');
the above is a code from the .js
file of WP infinite scroll Wordpress plugin.
Can we somehow put a PHP condition inside a js file:
If( logical condition 1 ) {
$('.class1').append( '' );
var button = $('.class1.load-more');
} elseif( logical condition 2 ) {
$('.class2').append( '' );
var button = $('.class2 .load-more');
}
P.S.: PHP logic should go inside a js
file not script<>
tags.
No comments:
Post a Comment