2013-03-16 1 views
0

문제가 있습니다. 컬러 박스 효과를 워드 프레스 테마에 통합하고 싶습니다 (플러그인 제외).플러그인 및 워드 프레스없는 컬러 박스 3.5.1 갤러리

<link rel="stylesheet" href="<?php echo get_template_directory_uri(); ?>/css/colorbox.css" /> 
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script> 
<script src="//ajax.googleapis.com/ajax/libs/jqueryui/1.10.1/jquery-ui.min.js"></script> 

이 :

<script src="<?php echo get_template_directory_uri(); ?>/js/jquery.colorbox.js"> </script> 
<script> 
    jQuery(document).ready(function(){ 
$("a[href$='.jpg'],a[href$='.png'],a[href$='.gif']").colorbox({transition:"elastic", maxWidth:"80%", maxHeight:"80%", slideshow:"true"}); 
}); 

그래서, 그와 함께, 하나의 이미지가 잘 작동 그래서 나는이 있습니다. 그들은 컬러 박스 창에서 열립니다. 하지만 갤러리에는 아무것도 없습니다. 는 그래서, 예를 들어, 다음과 같이, 갤러리 단축 코드에
link="file" 

을 추가 : 그와

[gallery ids="54,53,58,59,66" link="file"] 

, 좋은 colorbox 오픈 갤러리의 이미지. 그러나 문제는 각 이미지가 단일 이미지처럼 열리고 페이지 매김이 없음 (다음 이미지 및 이전 이미지 없음)

사이트를 로컬에서 테스트하고 있으므로 링크가 없습니다. Wordpress 3.5.1 플러그인 없음

이 문제를 해결하는 방법을 모르겠습니다.

누군가가 문제가있는 부분을 알고 있다면 매우 좋습니다.

감사합니다.

답변

0

그룹 클래스를 이미지에 연결하여 함께 연결할 수 있도록해야합니다.

이 예제에서 "group_name"은 각 이미지의 클래스의 일부가 될 것입니다. 그리고 내가 당신의 방법을 확실히 잘 못 시도하고 있기 때문에 내가 할 수 없습니다, 당신의 도움이 로버트의 colorbox를

$(".group_name").colorbox({rel:"group_name", transition:"elastic", maxWidth:"80%", maxHeight:"80%", slideshow:"true"}); 
0

감사를 호출하는 같은 클래스를 사용하는 대신 이미지 유형을 사용하는 이 일을하기 위해 도착합니다.

그래서, 당신의 코드를 추가, 그래서 지금은이 있습니다

 <script src="<?php echo get_template_directory_uri(); ?>/js/jquery.colorbox.js"></script> 
    <script> 
    jQuery(document).ready(function(){ 
$("a[href$='.jpg'],a[href$='.png'],a[href$='.gif']").colorbox({transition:"elastic", maxWidth:"80%", maxHeight:"80%", }); 
$(".group_name").colorbox({rel:"group_name", transition:"elastic", maxWidth:"80%", maxHeight:"80%", slideshow:"true"}); 
}); 
    </script> 

(나는이 너무 시도) :

$("a.group_name").colorbox({rel:"grou..... 

과 HTML 게시 판에,이를 넣어 :

[gallery ids="54,53,58,59,66" class="group_name"] 

나도이 아 파크 시도 :

[gallery ids="54,53,58,59,66" link="file" class="group_name"] 

하지만 아무 것도. 문제는 동일합니다. 페이지 매김 없음. 나는 정말로 희망이 없다 :-)

[편집] : 나는 [갤러리]와 작동하지 않는다는 것을 이해한다면.

<a href="http://localhost/.../......jpg" rel="group_name"><img src="http://localhost/.../....jpg" width="150" height="100" /></a> 
<a href="http://localhost/.../......jpg" rel="group_name"><img src="http://localhost/.../....jpg" width="150" height="100" /></a> 

그것은 잘 작동, 감사와

.

하지만 쉽지는 않습니다. 예를 들어, 클래스가 포함 된 WP 3.5.1 갤러리에 colorbox를 자동으로 포함 할 수 있습니까?