gpt4 book ai didi

css - Nivo slider 到 Wordpress 主题

转载 作者:行者123 更新时间:2023-11-28 13:33:43 25 4
gpt4 key购买 nike

我最近将 NIVO Slider 包下载到我的 table ​​面,因为我希望将它集成到我的 WP 主题中。

我已经将 JS 文件等压缩到我的目录中,但是我必须通过函数调用它吗?是否有快速教程,或者有人可以指出我如何执行此操作的方向。

我是否必须在 functions.php 文件中放置一个函数调用,然后将包装等添加到我希望查看的部分的正文以及文件夹中的图像?

我有一台滚动式自动取款机,但我觉得它不适合我的需要,并希望尽可能避免使用该插件。

谢谢柯斯蒂

代码:

放在Header.php中

<?php wp_enqueue_script('jquery'); ?>
<?php wp_head(); ?>
<!-- Include the Nivo Slider CSS file -->
<link rel="stylesheet" href="<?php bloginfo("template_url"); ?>/scripts/nivoslider/nivo-slider.css" type="text/css" media="screen" />
<!-- Include the Nivo Slider JS file -->
<script src="<?php bloginfo("template_url"); ?>/scripts/nivoslider/jquery.nivo.slider.pack.js" type="text/javascript"></script>
<!-- Set up the Nivo Slider -->
<script type="text/javascript">
jQuery(window).load(function() {
jQuery('#slider').nivoSlider();
});
</script>

放在page.php上面的内容:

<div id="sliderwrap">
<div id="slider">
<img src="<?php bloginfo("template_url"); ?>nemo.jpg" alt="" />
<img src="<?php bloginfo("template_url"); ?>toystory.jpg" alt="" />
<img src="<?php bloginfo("template_url"); ?>up.jpg" alt="" title="This is an example of a caption" />
<img src="<?php bloginfo("template_url"); ?>walle.jpg" alt="" />
</div>
</div>

最佳答案

我假设您使用的是 jQuery 硬编码版本?为什么不直接获得 Nivo for WordPress 版本,一个站点 19 美元。在 Nivo 网站上还有 jQuery 版本的完整教程。在这里查看:Nivo Slider Tutorial

关于css - Nivo slider 到 Wordpress 主题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13252611/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com