Answer the question
In order to leave comments, you need to log in
Answer the question
In order to leave comments, you need to log in
It comes out only by editing the template. Otherwise, the template will fail.
You can do so.
Option 1 - in general, whatever they are, they will be deleted. You need to edit the functions.php file in your theme folder. P.s. be careful here, you can cheat the template by editing this file, make backups.
global $wpdb;
$attachments = $wpdb->get_results( "
SELECT *
FROM $wpdb->postmeta
WHERE meta_key = '_thumbnail_id'
" );
foreach ( $attachments as $attachment ) {
wp_delete_attachment( $attachment->meta_value, true );
}
$wpdb->query( "
DELETE FROM $wpdb->postmeta
WHERE meta_key = '_thumbnail_id'
" );
try adding the following to functions.php
function my_post_image_html( $html, $post_id, $post_image_id ) {
if(is_singular() ){
$html = '';
}
return $html;
}
add_filter( 'post_thumbnail_html', 'my_post_image_html', 10, 3 );
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question