Advanced Custom Fields
-
Hi, if i use youtube video in custom field, plugin doesn’t work.
Is there a solution?
Thanks
V.
-
Hi V.;
You’d have to call lyte_parse() on the custom field, possibly using an ACF filter like acf/format_value (but that is ACF territory, really).hope this helps,
frankI have seen acf/format_value. But obviously i don’t understand how to use it.
Is there an example?Another way is to use native custom field of wordpress. In this way, how to use YouTube Lyte?
Thank you!!!
If I’m not mistaking, there’s example code on the linked page, but I’m not a ACF user myself so can’t really comment on that.
Just as for ACF, WordPress native custom fields can be LYTE’ed as well, but just as for ACF you’ll also need code to do so. Guess in that case in one of your theme files you’re pulling in the custom field, so that’s where you would do
lyte_parse($custom_field_value);frank
Please, don’t go! I am trying π
Please, don’t go!
not going anywhere, it’s raining cats and dogs outside π
well, thanks God it’s raining, i hope not too much.
In custom field i write: <iframe width=”560″ height=”315″ src=”videoURL” frameborder=”0″ allowfullscreen></iframe>
And in my content-video i write: <?php lyte_parse(the_meta());?>
So:
1. i see the video but LYTE in not applied.
2. in this way argument of lyte_parse() is always the sameit’ll be easier to just put the youtube URL in the custom field really, else we’ll need some additional logic to understand the iframe-code, can you try with a YT url (for now, at least)?
frank
Done, but return the url not the video.
did a quick test, use this instead;
echo lyte_parse(get_post_meta($post->ID, "my_vid", $single));where
my_vidshould be the name of your custom field.frank
Warning: strpos() expects parameter 1 to be string, array given in C:\sviluppo\htdocs\www\…\wp-content\plugins\wp-youtube-lyte\wp-youtube-lyte.php on line 98
Warning: preg_match_all() expects parameter 2 to be string, array given in C:\sviluppo\htdocs\www\…\wp-content\plugins\wp-youtube-lyte\wp-youtube-lyte.php on line 111
Warning: Invalid argument supplied for foreach() in C:\sviluppo\htdocs\www\…\wp-content\plugins\wp-youtube-lyte\wp-youtube-lyte.php on line 113
I am testing:
<?php echo lyte_parse(get_post_meta($post->ID, ‘link-video’ , true)); ?>
Seems it works. I am tryng again.
Frank, thank you!!
you’re welcome!
have fun,
frankmaybe have a look at this method:
http://support.advancedcustomfields.com/forums/topic/acf-with-plugin-youtube-lyte/
The topic ‘Advanced Custom Fields’ is closed to new replies.