- This topic has 1 reply, 1 voice, and was last updated 6 years, 4 months ago by shap.
- AuthorPosts
- January 22, 2018 at 2:36 am #4646shapParticipant
I have a second question.
How to make a post-thumbnail in the post? As it is in the list of posts.January 22, 2018 at 6:08 pm #4649shapParticipantI insert in wp-content/themes/hashone/template-parts/content-single.php:
<?php
/**
* Template part for displaying single posts.
*
* @package HashOne
*/?>
<article id=”post-<?php the_ID(); ?>” <?php post_class(); ?>>
<!– INSERT –>
<?php if ( ‘post’ == get_post_type() ) : ?>
<div class=”entry-meta hs-post-info”>
<?php hashone_posted_on(); ?>
</div><!– .entry-meta –>
<?php endif; ?><div class=”hs-post-wrapper”>
<?php if(has_post_thumbnail()): ?>
<figure class=”entry-figure”>
<?php
$hashone_image = wp_get_attachment_image_src( get_post_thumbnail_id() , ‘hashone-blog-header’ );
?>
” alt=”<?php echo esc_attr( get_the_title() ) ?>”>
</figure>
<?php endif; ?><header class=”entry-header”>
<?php the_title( sprintf( ‘<h3 class=”entry-title”>’, esc_url( get_permalink() ) ), ‘</h3>’ ); ?>
</header><!– .entry-header –><div class=”entry-categories”>
<?php echo hashone_entry_category(); ?>
</div>
<!– end INSERT –><div class=”entry-content”>
<?php the_content(); ?>
<?php
wp_link_pages( array(
‘before’ => ‘<div class=”page-links”>’ . esc_html__( ‘Pages:’, ‘hashone’ ),
‘after’ => ‘</div>’,
) );
?>
</div><!– .entry-content –>
</div></article><!– #post-## –>
- AuthorPosts
- You must be logged in to reply to this topic.