在WordPress中我試圖使用和錨點標籤環繞使用get_Permalink()作爲href的文章。這是我的代碼到目前爲止(這是在一個循環內)。WordPress的永久環繞塊元素
echo '<a href="' .get_permalink(). '">';
echo '<article class="col-xs-6 col-sm-3 port-box"> <!-- portflio article box -->';
the_post_thumbnail('portfolio-thumbnail', array('class' => 'img-responsive'));
echo '<div class="port-details focus-box">';
echo'<h3 class="latestnews-title red-border-bottom"><a href="'.get_permalink().'" title="'.get_the_title().'">'.get_the_title().'</a></h3>';
echo'<p>'.get_post_meta($post->ID, 'Portfolio-type', true).'</p>';
echo '<p>';
echo get_post_meta($post->ID, 'Details', true);
echo '</p>';
echo '</div>';
echo '</article>';
echo '</a>';
當我在看輸出代碼它顯示了一個錨標記被輸出,但永久不會將網址放入HREF。
是否可以將文章包裝在「a」標籤中?如果有的話,任何人都有一些關於如何使其工作的指導。
感謝
Thi工作!除了我需要在第一個php行中丟失「var」之外。 – Brendin
你可以建議編輯...對不起它的錯字 –