| 1 |
<?php get_header(); ?> |
| 2 |
<?php |
| 3 |
global $post; |
| 4 |
global $wpdb; |
| 5 |
?> |
| 6 |
<div id="container"> |
| 7 |
<div role="main" id="content"> |
| 8 |
<?php |
| 9 |
global $post; |
| 10 |
$args = array( |
| 11 |
'post_type' => 'gallery', |
| 12 |
'post_status' => 'publish', |
| 13 |
'name' => substr(basename( $_SERVER['REQUEST_URI'] ), strpos( basename( $_SERVER['REQUEST_URI'] ), "=")), |
| 14 |
'posts_per_page' => 1 |
| 15 |
); |
| 16 |
$second_query = new WP_Query( $args ); |
| 17 |
if ($second_query->have_posts()) : while ($second_query->have_posts()) : $second_query->the_post(); ?> |
| 18 |
<h1 class="home_page_title"><?php the_title(); ?></h1> |
| 19 |
<div class="gallery_box_single"> |
| 20 |
<?php the_content(); ?> |
| 21 |
<?php endwhile; else: ?> |
| 22 |
<div class="gallery_box_single"> |
| 23 |
<p class="not_found">Sorry - nothing to found.</p> |
| 24 |
<?php endif; ?> |
| 25 |
<?php |
| 26 |
$posts = get_posts(array( |
| 27 |
"showposts" => -1, |
| 28 |
"what_to_show" => "posts", |
| 29 |
"post_status" => "inherit", |
| 30 |
"post_type" => "attachment", |
| 31 |
"orderby" => "menu_order ASC, ID ASC", |
| 32 |
"post_mime_type"=> "image/jpeg,image/gif,image/jpg,image/png", |
| 33 |
"post_parent" => $post->ID |
| 34 |
)); |
| 35 |
if( count($posts) > 0 ) { |
| 36 |
?> |
| 37 |
<ul class="gallery clearfix"> |
| 38 |
<?php foreach($posts as $attachment) { |
| 39 |
$image_attributes = wp_get_attachment_image_src( $attachment->ID, 'foto-thumb' ); |
| 40 |
$image_attributes_large = wp_get_attachment_image_src( $attachment->ID, 'large' ); |
| 41 |
?> |
| 42 |
<li> |
| 43 |
<a rel="prettyPhoto[gallery]" href="<?php echo $image_attributes_large[0]; ?>"> |
| 44 |
<img style="width:157px;height:116px;" alt="" title="" src="<?php echo $image_attributes[0]; ?>" /> |
| 45 |
</a> |
| 46 |
</li> |
| 47 |
<?php } } ?> |
| 48 |
</ul> |
| 49 |
<div class="clear"></div> |
| 50 |
</div> |
| 51 |
</div> |
| 52 |
</div> |
| 53 |
<?php get_sidebar(); ?> |
| 54 |
<script type="text/javascript"> |
| 55 |
$(document).ready(function(){ |
| 56 |
$("a[rel^='prettyPhoto']").prettyPhoto({theme: 'dark_square'}); |
| 57 |
}); |
| 58 |
</script> |
| 59 |
<?php get_footer(); ?> |