【发布时间】:2012-10-20 04:48:20
【问题描述】:
所以朋友们,我正在尝试在我的 wordpress 主题中使用 prettyPhoto,但它根本不起作用。它的两个文件 - prettyPhoto.css 和 jquery.prettyPhoto.js 都在 header.php 文件中正确链接。
这是我的 header.php 文件中文件的链接 -
<link rel="stylesheet" href="<?php bloginfo('stylesheet_directory'); ?>/js/prettyPhoto/css/prettyPhoto.css" type="text/css" media="screen" title="prettyPhoto main stylesheet" charset="utf-8" />
<script src="<?php bloginfo('stylesheet_directory'); ?>/js/prettyPhoto/js/jquery.prettyPhoto.js" type="text/javascript"></script>
如果这个问题是由于没有使用 wp_enqueue_script() 造成的,请告诉我。
这就是我如何链接要与 prettyPhoto 一起使用的图像 -
<a title="test image" href="images/new-image.png" rel="prettyPhoto[]"><img src="images/new-image.png" alt="Some Alternate Text" /></a>
当我点击图片时,它不会在 prettyPhoto 中打开。
【问题讨论】: