icon on feature image if it is not a video

Posted in: Newspaper
Post count: 23

i have to show an icon like the one you see when you use a video page. any idea how i can accomplish this. this is a screen shot of what i want to accomplish.http://screencast.com/t/bxLrSvKPUg

Post count: 64

Hi,

I’ve done something similar, it might be easy but you need to give more details please. Like what’s the trigger to show the icon. By default, the theme triggers the icon on the thumb if post type is video.

Would your trigger be, for example, show icon on thumb if post type is regular and categories/tags are A,B,C?

Here’s mine: show icon on thumb if post is regular type (or not a video post type) but the post has a link to a video or has a video embed.

(note that the thumb itself does not get the icon printed in it. the theme overlays an icon image. this means, for example, that the icon will not show when the post is shared on fb or similar, regular feat image with no icon is shared)

Cheers!

Post count: 23

i tought it would be standard or aside post format. i like your way how did you do it

Post count: 64

I installed this plugin video-thumbnails

It does what NP6.4 theme does for video post types. The differences are it does it for every post type and it doesn’t have a box to input the video’s url. It scans the post content and grabs the first url of a video, fetch the thumbnail and set it as featured image.

This is nice because it won’t interfere with the theme video post type, since in those custom post you put the video url in the box and not in the content, the plugin wont scan any video and the theme will keep working as intended.

So, 1st step is install plugin, 2nd is to make the theme know there’s a video in the post.

Fortunately, the plugin has a function for this so you just need to add it to the theme. Edit the following file:
/public_html/wp-content/themes/Newspaper/includes/wp_booster/td_module.php
lines 282 and 283 should be like this (NP6.4)
// on videos add the play icon
if (get_post_format($this->post->ID) == 'video') {

replace with:
// on videos add the play icon
if (get_post_format($this->post->ID) == 'video' || get_video_thumbnail($this->post->ID) != null) {

Done!

It should work flawlessly, sometimes I use the theme video post type which is awesome and other times I paste a video in a regular post, sometimes just to have a thumbnail 🙂
The plugin doesn’t trigger if you (only) use the theme video playlist because the shortcode only has video id’s and not urls.
You can simply paste a link to a video, it will work but those links can show up in excerpts, so use [embed][/embed] if the video url is the 1st thing in the post content or comes before the excerpt length you have defined at the theme’s panel.

Hope it hepls, cheers!

Post count: 64

sorry about bad English, I was in a hurry…!

Post count: 23

sorry i didn’t stated it clearly enough i want to show an icon of a camera for example when it shows feature picture if it is an article and if it it is a video it must stay on defauld.

Post count: 7909

Hi,

Thanks @nf_prt for your help!


@StephanusD
You have to create an else statement here, after the video format condition and add a similar code(just change the image path) – http://screencast.com/t/yHklZv7Cxhttp://pastebin.com/Y8M9Ehka and upload your image to the specified path images/icons/yourimage.pnghttp://screencast.com/t/UwyOR6Q77
It should work fine – http://screencast.com/t/nCUIvAvye

If you don’t know how to do it or you need additional customization I suggest to hire someone to do this for you, as we cannot provide custom work, sorry!

Viewing 7 posts - 1 through 7 (of 7 total)
You must be logged in to reply to this topic.