ckubs george
asked 9 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( ), I have another article where I did the same and it doesn’t( ).

Thank you. 🙂

1 Answers
answered 9 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( ), you have a link there before the video : Nu ma uita( it has the struceture like this :<a href="" onclick="__gaTracker('send', 'event', 'outbound-article', '', '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.

replied 9 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