Forum Replies Created

Viewing 1 replies (of 1 total)
  • Thread Starter arthurarthur

    (@arthurarthur)

    add_filter('post_thumbnail_html', function($html, $post_id, $post_thumbnail_id, $size, $attr) {

    if (!empty($html)) {
    return $html;
    }

    if (wp_is_mobile()) {
    return ''; // Don't display anything on mobile
    }

    $default_image_url = 'ADD LINK HERE';

    $alt = esc_attr(get_the_title($post_id));
    return '<img src="' . esc_url($default_image_url) . '" alt="' . $alt . '" class="wp-post-image" />';
    }, 10, 5);
    • This reply was modified 10 months, 3 weeks ago by arthurarthur.
Viewing 1 replies (of 1 total)