Forum Replies Created

Viewing 2 replies - 1 through 2 (of 2 total)
  • Yes, seems this plugin doesn’t understand short yt-urls. The solution is to get the ID from the link and then use lyte_preparse with the id. Filters any Youtube url with regexp.

    $pattern = "/^(?:http(?:s)?:\/\/)?(?:www\.)?(?:m\.)?(?:youtu\.be\/|youtube\.com\/(?:(?:watch)?\?(?:.*&)?v(?:i)?=|(?:embed|v|vi|user|shorts)\/))([^\?&\"'>]+)/";
    $result = preg_match( $pattern, get_field( 'videofield', false, false ), $matches );
    
    if ( false !== $result ) {
      echo lyte_preparse( $matches[1] );
    }
    

    ( Using the raw field value here to perform better with oEmbed field. If not, skip the extra false, false… )

    • This reply was modified 3 years, 2 months ago by Daniel Ostman.
    Plugin Author Daniel Ostman

    (@daniel-ostman)

    Hello,

    Sorry for late reply, didn’t see it before. To change the style you have to add a style to your style.css-file. You can edit it in WordPress, Appearance > Editor.

    For example:

    hr {
      border: 0;
      height: 1px;
      background-color: #eee;
    }
Viewing 2 replies - 1 through 2 (of 2 total)