2012-10-20 61 views
-2

所以朋友,我想在我的WordPress主题中使用prettyPhoto,但它根本不工作。它的两个文件 - prettyPhoto.css和jquery.prettyPhoto.js在header.php文件中正确链接。prettyPhoto不工作在我的wordpress主题

这是我的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打开。

回答

0

你有没有建立一个自定义的主题,让它工作。如果是这样的话,可能会有其他依赖文件,如header.php index.php或footer.php,这可能会导致它不工作。切换到默认的二十一个主题,看看它是怎么回事。如果它在那里工作,那么你的主题文件有问题,可能是footer.php或index.php et-al。

+0

footer.php或index.php文件有什么问题,如果我必须将代码放在编辑器中?有一件事,我把漂亮的照片的额外代码放在header.php文件中... – Umar

+0

你有没有试过为二十一个主题启用prettyphoto – defau1t

+0

我已经创建了我自己的主题,所以我不想在二十一... – Umar