Home Forums HashOne Post-thumbnail in the post

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #4646
    shap
    Participant

    I have a second question.
    How to make a post-thumbnail in the post? As it is in the list of posts.

    #4649
    shap
    Participant

    I 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-## –>

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.