Archived topic
Remove entry-content from Post Format Image on Archive page
5 replies · Started by Manoj on January 21, 2023
Hi
Is there a way to remove the entry-content from Post Format Image stories on Archive page?
Also the Excerpt text is not showing to all Post Format Image stories.
Thanks
Hi there,
do you have any custom functions or templates that would change the behaviour of the archives ?
Reason i am asking, the posts in that archive are showing the Entry Content ( Full post content ) not the Entry Summary ( Excerpt ) that i would expect to see.
Nope, I'm using the default template for Photos Archive page.
If you see, there are two stories on the page and both are showing differently.
- First one is showing the Entry Content (Full post content).
- Second one is showing Entry Summary (Excerpt)
Thanks
I think we would need a separate template for those, as the theme doesn't have a content template for the image format.
So if you have a child theme, you could save your own content-image.php template.
And inside that add this:
<?php
/**
* The template for displaying format image posts within the loop.
*
* @package GeneratePress
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}
?>
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?> <?php generate_do_microdata( 'article' ); ?>>
<div class="inside-article">
<?php
/**
* generate_before_content hook.
*
* @since 0.1
*
* @hooked generate_featured_page_header_inside_single - 10
*/
do_action( 'generate_before_content' );
if ( generate_show_entry_header() ) :
?>
<header <?php generate_do_attr( 'entry-header' ); ?>>
<?php
/**
* generate_before_entry_title hook.
*
* @since 0.1
*/
do_action( 'generate_before_entry_title' );
if ( generate_show_title() ) {
$params = generate_get_the_title_parameters();
the_title( $params['before'], $params['after'] );
}
/**
* generate_after_entry_title hook.
*
* @since 0.1
*
* @hooked generate_post_meta - 10
*/
do_action( 'generate_after_entry_title' );
?>
</header>
<?php
endif;
/**
* generate_after_entry_header hook.
*
* @since 0.1
*
* @hooked generate_post_image - 10
*/
do_action( 'generate_after_entry_header' );
/**
* generate_after_entry_content hook.
*
* @since 0.1
*
* @hooked generate_footer_meta - 10
*/
do_action( 'generate_after_entry_content' );
/**
* generate_after_content hook.
*
* @since 0.1
*/
do_action( 'generate_after_content' );
?>
</div>
</article>
That will remove the entry-content altogether
Hi David,
Thank you so much for the template code and it fixed the issue.
Glad to hear that!!