ckubs george
asked 6 years ago

How Featured video works in DW Focus theme? I have one article where I put a video link and it shows on top, instead of the featured image( http://goo.gl/kvwm8O ), I have another article where I did the same and it doesn’t( http://goo.gl/fPt4a6 ).

Thank you. 🙂

1 Answers
Allen
answered 6 years ago

@ckubs george : hi , thanks you for using our theme.In DW Focus, we use a function to detect the first video link you have in your post to make it display on top. At the second link you sent( http://blogshot.ro/relaxative/muzicalit/racla-anda-adam-continuarea-uita-16-ani/ ), you have a link there before the video : Nu ma uita( it has the struceture like this :<a href="https://www.youtube.com/watch?v=DbYh6NPtwgk" onclick="__gaTracker('send', 'event', 'outbound-article', 'https://www.youtube.com/watch?v=DbYh6NPtwgk', 'Nu ma uita');" target="_blank">Nu ma uita</a> ), so the function will be mess up, to fix this problem , you can open file : dw-focus/inc/init.php
go to line 161, change code from line 161->171 to :

foreach ( $lines as $line ) {
            $line = trim( $line );
            if ( preg_match('/<a[^>]+href=\"([^\"]+)\"[^>]*>(.+)<\/a>([\S\s]*)/', $line, $reg_matches ) ) {
                $ret = wp_oembed_get( $reg_matches[1] );
                return $ret;
            } elseif ( preg_match( $pattern, $line, $matches ) ) {
                if ( strpos( $matches[0], '[' ) === 0 ) {
                    $ret = do_shortcode( $matches[0] );
                } else {
                    $ret = wp_oembed_get( $matches[0] );
                }
                return $ret;
            }

        }

Hope this help.

ckubs
replied 6 years ago

It didn’t worked or maybe I had tocelar the cache too. Nevermind, at last I know now what is the problem.

For the first video URL, the source of the conflict, I used google URL shortener and everything is good. And I’ll do that whenever I’ll have the same situation.

Thank you.

Powered by DW Question & Answer Pro