Add Custom Field to single.php

Discussion in 'Compass WordPress Theme' started by floopie, Jun 9, 2015.

Thread Status:
Not open for further replies.
  1. floopie

    floopie New Member

    Joined:
    Jun 8, 2015
    Messages:
    9
    Likes Received:
    0
    Hey Guys,
    i´ve tried to add a custom field into the single.php and it does not show up as i wished. I´ve added youtube Video iframes to a custom field and tried to show it up on single.php. Tried this:

    PHP:
    <div style="width:1055px;height:593px;z-index:2000">
            <?php echo get_post_meta($post_id'youtube'true); ?>
            </div>
    The Container appears, but Video doesn´t show. Any suggestions?

    To make ist a bit easier here´s the domain: http://www.floopie.de

    Thanks for helping!
     
  2. Sobhagya

    Sobhagya Guest

    Joined:
    May 29, 2015
    Messages:
    414
    Likes Received:
    6
    Hello,

    Hope Doing Good.

    If you wish to add youtube iframe on your website page.

    Please use YouTube embed iframe code instead of PHP code.

    Hope you find it helpful,

    Do let me know if you need more assistance,
     
  3. floopie

    floopie New Member

    Joined:
    Jun 8, 2015
    Messages:
    9
    Likes Received:
    0
    Hi,
    there is no other way to embed Youtube Videos via Custom Field. I have to save Youtube embed code in custom field and call custom field in the template (single.php). There must be an option, because it worked in previous theme.

    Thanks
     
  4. floopie

    floopie New Member

    Joined:
    Jun 8, 2015
    Messages:
    9
    Likes Received:
    0
    Ok. Fixed the Problem with plugin "Advanced custom fields".

    Thank for patience
     
Thread Status:
Not open for further replies.

Share This Page