- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
<?php
$my_query = new WP_Query(array("post_status" => "publish",
"post_type" => "portfolio",
"nopaging" => true,
"orderby" => "date",
"name" => "foto"));
foreach($my_query->posts as $album)
{
foreach(simple_portfolio_media($album->ID) as $media)
{
$query = new WP_Query(array('post_type' => 'attachment', 'p' => $media['value']));
$title = $query->post->post_title;
$src = wp_get_attachment_image_src($media['value'], 'thumbnail');
$src_full = wp_get_attachment_image_src($media['value'], 'full');
?>
<p><a href="<?php echo $src_full[0]; ?>" title="<?php echo $title;?>" rel="gallery"><img src="<?php echo $src[0]; ?>" alt="" /><?php echo $title;?></a></p>
<?php
$cnt++;
if($cnt >= 4) break;
}
}
?>
Показывает последние 4 фотки из альбома в портфолио.
Ну, WordPress.
Lure Of Chaos 11.02.2012 00:41 # +2
varg242 07.09.2012 17:29 # +1
guest 07.09.2012 16:49 # 0
varg242 07.09.2012 17:29 # 0
guest8 09.04.2019 12:39 # −999