Support

Account

Home Forums Add-ons Repeater Field Using sub fields for div IDs in inline content

Solved

Using sub fields for div IDs in inline content

    • marindee

    • September 19, 2013 at 8:37 am

    I have purchased both your repeater fields add-on and your flexible content add-on. I’m using both in my code to display my content in this particular situation. However, this pertains more the repeater field.

    I’m trying to target a series of videos and have embedded ACF fields for most of the video parameters and it’s working just great. I’m using Easy Fancybox to display the videos inline (fancybox-inline). The problems occurs when I try to replace the “id” with an ACF field, so I can use the one chunk of video code for all my videos. I have id="<?php the_sub_field("video_id"); ?>"on the video div block and href="#<?php the_sub_field("video_id"); ?>" on the link that launches the video. That doesn’t work. However, when I replace it with something like, id=movie and a href=”#movie”, it works just fine.

    What am I doing wrong? Am I using the wrong syntax?

    Please help.

    Thanks,
    Dee

    • Elliot

    • September 19, 2013 at 2:00 pm

    Hi @marindee

    Can you post your entire code? Perhaps the links are not within the repeater loop so the sub field function doesn’t work?

    Thanks
    E

    • marindee

    • September 19, 2013 at 2:27 pm
    This reply has been marked as private.
    • marindee

    • September 20, 2013 at 6:05 am

    I might look at another way of writing this code. It might not have been the most efficient. I will let you know if I have further issues.

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.

We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Cookie Policy. If you continue to use this site, you consent to our use of cookies.