User’s should always keep your theme up to date and creating a child theme isn’t hard.
How do I remove the featured image from the post (but not from the post preview)?
I just tried to include different CSS codes from the forum and search (to functions.php or custom CSS) but nothing worked out.
I think I get it so try this, make a child theme of that Destin Basic theme.
https://codex.www.ads-software.com/Child_Themes
Create a new directory named wp-content/themes/destin-basic-child
and in that directory put these two files style.css
and functions.php
.
In style.css
put these lines.
/*
Theme Name: Destin Basic Child Theme
Description: Child theme for Destin Basic theme
Version: 0.1
Template: destin-basic
*/
In functions.php
put these lines.
<?php
// Queue up the parent theme's stylesheet
add_action( 'wp_enqueue_scripts', 'mh_child_style' , 5 );
function mh_child_style() {
wp_enqueue_style( 'destin-basic-parent-style', get_template_directory_uri() . '/style.css' );
}
// Replace the featured image in posts only with a HTML comment
add_filter( 'post_thumbnail_html', 'mh_post_image_html', 10, 3 );
function mh_post_image_html( $html, $post_id, $post_image_id ) {
if( is_single() ) {
$html = '<!-- The featured image would be here if I chose to display it. ;) -->';
}
return $html;
}
What this does is replaces the featured image with an HTML comment. No image. But it only does it for posts and nothing else.
You’ll still have a featured image for the post. It just will not be displayed when you view the post.