小さなポートフォリオ ショーケースとしてメイン インデックス ページに 4 つの画像がリストされています。各 div クラスには「margin-right」属性があります。そのため、「最後のクラス」を追加してその特定の属性を削除する方法を見つけます。
私が現在使用しているコードは次のとおりです。
<div id="latestlistings" >
<div class="inner">
<?php $recent = new WP_Query('post_type=listing&post_status=publish&posts_per_page='.get_option('wp_recentlistingsnumber_home')); ?>
<h3><?php echo get_option('wp_heading_recentlistings') ?></h3>
<?php if ($recent->have_posts()) : while ($recent->have_posts()) : $recent->the_post(); ?>
<?php include 'includes/variables.php' ?>
<div class="latestlisting">
<?php $sliderimages = get_post_meta($post->ID, 'images_value', true);
if ($sliderimages) {
$arr_sliderimages = explode("\n", $sliderimages);
} else {
$arr_sliderimages = get_gallery_images();
}
$firstimage = $arr_sliderimages[0];
$arr_sliderimages = parse_url($firstimage);
$resized = timthumb(100, 200, $arr_sliderimages[path], 1);
?>
<a href="<?php the_permalink(); ?>"><img width="200" height="100" src="<?php echo $resized ?>" /></a>
<div class="shadow-small"></div>
</div>
</div>
これを最善の方法で達成する方法について、誰かアイデアや提案はありますか? いくつかのアドバイスをいただければ幸いです - どうもありがとうございました!