我有一個PHP while循環如下:PHP循環沒有被應用特定HTML元素
<?php while (have_posts()) : the_post(); ?>
<li>
<?php
$args = array(
'post_type' => 'attachment',
'numberposts' => -1,
'post_status' => null,
'post_parent' => $post->ID,
'orderby' => 'menu_order',
'order' => 'ASC'
);
$attachments = get_posts($args);
if ($attachments) {
foreach ($attachments as $attachment) {
$image_attributes = wp_get_attachment_image_src($attachment->ID, large);
$alt_text_title = $attachment->post_title ;
//print_r($attachment);
echo "<img src=\"$image_attributes[0]\" alt=\"$alt_text_title\">";
}
}
?>
<h3><a href="http://<?php the_title(); ?>"><?php the_title(); ?></a></h3>
<?php the_content(); ?>
</li>
<?php endwhile;?>
的的H3內部的標籤,使所有的標題鏈接,但是我想這些標題的一個不一個鏈接因此不會受到a標籤的影響..
這可能嗎?
什麼the_title()?你在使用某種框架嗎? – Toping
這是一個wordpress主題。 –
wordpress for the portfoio ... the_title()正在爲相關項目添加插入的標題。 – Alex