0

I'm using a PHP code on my wesbiste to get thumbnails of vimeo videos. here is the code :

<?php
  echo '<img src="' . get_vimeo_thumb('43096888', 'thumbnail_large') . '" class="image_page_texte_et_medias" style="cursor:pointer" >';
  ?>

I'm using a ACF custom field with the video ID

<?php the_sub_field('vimeo'); ?>

What I'm trying to do is to replace the ID in my first php code ('43096888') by :

<?php the_sub_field('vimeo'); ?>

can anybody help me with this,

thanks a lot,

1
  • 1
    I'm not sure how your code works...how about: get_vimeo_thumb(the_sub_field('vimeo'), 'thumbnail_large') ?? Commented Mar 4, 2014 at 15:42

3 Answers 3

0

aren't you allowed to use variables as arguments? something like:

<?php
$foo = the_sub_field('vimeo');
  echo '<img src="' . get_vimeo_thumb($foo, 'thumbnail_large') . '" class="image_page_texte_et_medias" style="cursor:pointer" >';
  ?>
Sign up to request clarification or add additional context in comments.

1 Comment

if it worked please set my answer as usefull :) Any other questions im happy to help.
0
<?php
  echo '<img src="' . get_vimeo_thumb(the_sub_field('vimeo'), 'thumbnail_large') . '" class="image_page_texte_et_medias" style="cursor:pointer" >';
?>

Comments

0
<?php
echo '<img src="' . get_vimeo_thumb(the_sub_field('vimeo'), 'thumbnail_large') . '" class="image_page_texte_et_medias" style="cursor:pointer" >';
?>

You can simply replace the string '43096888' with your function the_sub_field('vimeo') if that's something what you want.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.