How to hide the Thumb Placeholder

Posted in: Newspaper
Post count: 7

On my site, only scattered articles have featured images.

I do NOT want the thumb placholder to show up when there is no feature image. Rather, I want no image to show up. I just want the text to show up.

How can I disable thumb placeholders entirely?

Post count: 7

Any ideas here? Really need to get rid of thumb placeholders.

I’m a coder, so if the solution is CSS or javascript, that’s fine, but I notice there’s no css class for no-thumb. It just acts as if it’s the actual featured image.

Would love some suggestions.

Post count: 18283

Hello !

Unfortunately there is no option for this. You will have to work some code to fit it. Unfortunately due being custom code it is not covered by the support team.

Thank you !

Post count: 7

Thanks Vlad. I’ve been noticing that. I tracked it down somewhat:

There is code in the PHP file /wp-content/plugins/td-composer/legacy/common/wp_booster/td_module.php
(or alternately /wp-content/plugins/td-cloud-library/includes/tdb_module.php, where similar code lives).

$custom_placeholder = td_util::get_option('tds_thumb_placeholder');

That thumb placeholder appears to get assigned, in the case of no featured image, on this line:

} else if( $custom_placeholder != '' && $css_image === true ) {
    $td_temp_image_url[0] = $custom_placeholder;

Then the assignment appears to be used here to render the thumbnail:

$buffy .= '<span class="entry-thumb td-thumb-css" data-type="css_image" data-img-url="' . $td_temp_image_url[0] . '" ' . $retina_image . ' ></span>';

That option tds_thumb_placeholder is being defined in the wordpress database. It’s in the wp_options table, in the rows with option_name td_011 and td_011_settings. Unfortunately, the option_value for those two items are PHP serialized data, and contain an insane 2,500 rows of information (all inside one single database cell — over 256kb of data).

Trying to unserialize the data using online tools has proven fruitless.

I’m thinking of writing additional PHP code near those if statements to simply add a class like “no-thumb” when there is no featured image. Of course overwriting plugin code is a challenge, as there’s no such thing as a “child plugin” the way there is a “child theme”, but I’m sure there’s a way to do that without risking issues when the plugin is updated.

I built the whole site in about 4 hours, then I’ve spent 4+ hours trying to hide just that one thumbnail. Can it be added as a feature request to be able to turn off thumbnail placeholders? I see from searching around that I’m not the first person to ask.

Cheers,
Michael

Post count: 7

To fix this, I’ve edited the plugin directly under plugins -> plugin editor (WARNING to anyone else reading this, if tagDiv updates their plugin, there is a risk they will overwrite this change and you’ll have to make it again).

Then I chose tagDiv composer from the dropdown on the top right and clicked apply. I navigated to legacy -> common -> booster and clicked on td_module.php. Then I clicked into the code area and typed cmd-f (ctrl-f for windows) and searched for this:

class="td-image-wrap

I replaced that line that starts with $buffy, with the following code:

	            
                if ( is_null( $this->post_thumb_id ) ) {
                    $no_thumbnail = 'no-thumb';
                } else {
                    $no_thumbnail = '';
                }
                $buffy .= '<a>href . '" rel="bookmark" class="td-image-wrap ' . $no_thumbnail . $video_popup_class . '" title="' . $this->title_attribute . '" ' . $video_popup_data . '>';

I now have a “no-thumb” class which shows up then there is no thumbnail, and am able to use that to hide the thumbnail anchor (“a”) element entirely via CSS.

Viewing 5 posts - 1 through 5 (of 5 total)
The forum ‘Newspaper’ is closed to new topics and replies.