Ben yüklenen görüntülerin bir dizi yankıları bir php komut dosyası var ve ben serisinin yankılandı ilk görüntüye bir sınıf uygulamak gerekir. Bu mümkün mü? Ben 10 görüntüleri ve sadece ilk görüntü için bir sınıf uygulamak istiyorsanız Örneğin, onu nasıl hakkında gitmek istiyorsunuz?
İşte kod ben çalışıyorum, bir:
<div id="gallery">
<?php
query_posts('cat=7');
while(have_posts())
{
the_post();
$image_tag = wp_get_post_image('return_html=true');
$resized_img = getphpthumburl($image_tag,'h=387&w=587&zc=1');
$url = get_permalink();
$Price ='Price';
$Location = 'Location';
$title = $post->post_title;
echo "<a href='$url'><img src='$resized_img' width='587' height='387' ";
echo "rel=\"<div class='gallery_title'><h2>";
echo $title;
echo "</h2></div>";
echo "<div class='pre_box'>Rate:</div><div class='entry'>\$";
echo get_post_meta($post->ID, $Price, true);
echo "</div><div class='pre_box'>Location:</div><div class='entry'>";
echo get_post_meta($post->ID, $Location, true);
echo "</div>\"";
echo "'/></a>";
echo "";
}
?>
Hat 13, kod şöyle görünür:
echo "<a href='$url'><img src='$resized_img' width='587' height='387' ";
Sadece ilk öğe için, ben bu gibi bakmak gerekir:
echo "<a href='$url' class='show'><img src='$resized_img' width='587' height='387' ";
EDIT:
Yani bu gibi bakmak herkesin önerileri okuduktan sonra kodumu güncelledik:
<?php
query_posts('cat=7');
while(have_posts())
{
the_post();
$image_tag = wp_get_post_image('return_html=true');
$resized_img = getphpthumburl($image_tag,'h=387&w=587&zc=1');
$url = get_permalink();
$counter = 0;
$Price ='Price';
$Location = 'Location';
$title = $post->post_title;
while(have_posts())
{
$counter++;
if ($counter > 1) {
echo "<a href='$url'><img src='$resized_img' width='587' height='387' ";
} else {
echo "<a href='$url' class='show'><img src='$resized_img' width='587' height='387' ";
}
}
echo "rel=\"<div class='gallery_title'><h2>";
echo $title;
echo "</h2></div>";
echo "<div class='pre_box'>Rate:</div><div class='entry'>\$";
echo get_post_meta($post->ID, $Price, true);
echo "</div><div class='pre_box'>Location:</div><div class='entry'>";
echo get_post_meta($post->ID, $Location, true);
echo "</div>\"";
echo "'/></a>";
echo "";
}
?>
Sonra benim tarayıcı çöktü, bu yüzden ben .... birlikte doğru bir öneriniz bu koymadı şüpheli?