How to add an excerpt to an image post

Hi everyone :blush:

I would like to change the appearance of my image posts on the blog page aka category site. Now there is the title, under the title is the image and that’s it. But i want to add an excerpt just like in a standard Post. So title, then image, then excerpt.

How can i alter this preset in the child theme (i suppose it’s done in the child theme…)?

My site is http://wegerfinder.de/category/blog/ I’ve set up an Image post to test it.

Thanks in advance!!!

Hi there,

Please add a Child Theme and create necessary folders like this there:

x-child/framework/views/integrity/

And add a new file there called content-image.php

Add the code below there:

<?php

// =============================================================================
// VIEWS/INTEGRITY/CONTENT-IMAGE.PHP
// -----------------------------------------------------------------------------
// Image post output for Integrity.
// =============================================================================

?>

<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
  <div class="entry-featured">
    <?php x_featured_image(); ?>
  </div>
  <div class="entry-wrap">
    <?php if ( is_single() ) : ?>
    <header class="entry-header">
      <h1 class="entry-title"><?php the_title(); ?></h1>
      <?php x_integrity_entry_meta(); ?>
    </header>
    <?php x_get_view( 'global', '_content', 'the-content' ); ?>
    <?php else : ?>
    <header class="entry-header center-text">
      <h2 class="entry-title">
        <a href="<?php the_permalink(); ?>" title="<?php echo esc_attr( sprintf( __( 'Permalink to: "%s"', '__x__' ), the_title_attribute( 'echo=0' ) ) ); ?>"><?php x_the_alternate_title(); ?></a>
      </h2>
      <?php x_integrity_entry_meta(); ?>
    </header>
    <?php endif; ?>
    <?php x_get_view( 'global', '_content', 'the-excerpt' ); ?>
  </div>
  <?php x_get_view( 'integrity', '_content', 'post-footer' ); ?>
</article>

This is for integrity stack. If you are using another stack you will do the same for that specific stack file.

Also, the excerpt of the image post can be added using the excerpt box in the post edit page. If you do not see the excerpt box, click on the Screen Options at the top right section of the edit page and enable Excerpts box there.

Thank you.