How to remove fresh posts (latest news) on the main page? [closed]
-
14-04-2021 - |
其他提示
From what I understand you want to remove the entire section outlined in red on your picture?
To do that, go into the admin > appearance > editor. Then on the right, find home.php and click it to edit the file.
Remove the following code from the file and click "Update File" to save...
<?php if ( !have_posts() ) : ?>
<div class="alert">
<?php esc_html_e( 'Sorry, no results were found.', 'virtue' ); ?>
</div>
<?php get_search_form();
endif;
if( $summary == 'full' ){
while (have_posts()) : the_post();
get_template_part( 'templates/content', 'fullpost' );
endwhile;
} else {
while (have_posts()) : the_post();
get_template_part( 'templates/content', get_post_format() );
endwhile;
}
/**
* @hooked virtue_pagination - 10
*/
do_action( 'virtue_pagination' );
?>
Important Note
This will make an edit directly to your theme. A better way to do this is to make a CHILD THEME, then edit the file there. This will prevent you from losing any edits when your theme updates.