问题
I try to display a featured image below the blog-post title. actually my posts look like:
WP-header
post-title
date | author | comments
post content
tag | category
My goal is to get a full-sized-image (featured image) between post-title
& date | author | comments
Actually I am using a Corpo Theme.
Any ideas?
Best Regards
回答1:
You can fetch featured image using following code and paste it after post-title
which should be <?php the_title() ?>
<?php
if ( has_post_thumbnail()) {
$large_image_url = wp_get_attachment_image_src( get_post_thumbnail_id(), 'large');
echo '<a href="' . $large_image_url[0] . '" title="' . the_title_attribute('echo=0') . '" >';
the_post_thumbnail('thumbnail');
echo '</a>';
}
?>
Since i haven't seen your full code so i can help you up-to this.
See Codex Tutorial
来源:https://stackoverflow.com/questions/21682150/wordpress-add-featured-image-below-post-title