[英]How can i create Featured Image function in core php not in wordpress
[英]How can I make a jQuery script for each image featured in wordpress?
我希望每个wordpress特色图片都可以产生特殊效果,请在Jquery中举个例子帮助我?
我会帮一个例子
我是初学者,因此请您提供帮助
我对在Wordpress中起作用的效果感兴趣...因为静态(其他)知道如何执行此操作
示例可以是任何事情,我想知道如何在WP中调用Jquery中的所有图像。
提前致谢!
如果所有精选图像都具有相同的类(wp-post-image):
$('.wp-post-image').each(function(index,element){
// $(element) is Your current featured image
//add mouseenter and mouseleave event
$(element).hover(function() {
//add css class or style element with JS
$( this ).addClass( "hover" );
}, function() {
//remove css class or style element with JS
$( this ).removeClass( "hover" );
});
});
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.