Support

Account

Forum Replies Created

  • @EbbandFlow, well…im trying to get this to work with the Repeater.

    At first, I had an ‘endwhile’ error – but I believe that was due to what I assume was a typo in the code above.

    You had:

    foreach($videos as $video): ?>

    and I switched the colon to a semi-colon – and that seemed to fix the ‘endwhile’ error that I was getting.

    foreach($videos as $video); ?>

    Basically, the steps I did was…

    — I copied and paste the code you included specifically for the Functions.php

    — I then, used the recent Repeater code above on my template page where I wanted the video thumbnails to show.

    — I created a Repeater field type, with the field named as: ‘video’

    — Within the Repeater field type, I created a Sub Field (oEmbed) named: ‘video_url’

    — The field key I am using (as mentioned in the code) is from my Repeater field type (‘video’) ex: field_544302b1vr92e

    — I then go to my created post, and add a Youtube URL (as usual) within the repeater section and update the post page…

    At this point, I dont get any errors – but, I also do not get any YouTube Thumbnail or videos results either…hmmm…am i missing something? :-/

  • Thanks @EbbandFlow – Unfortunately, im still running into issues…hmmm…this has been pretty frustrating…lol.. :-/

    However, I appreciate your help to this point. thanks.

  • Thanks @scheurta and @EbbandFlow!!…Im trying to use the code you provided and it seems im getting close…however, im still struggling abit on getting it to all work properly…


    @EbbandFlow
    – I followed your code instructions and tested it for a ‘Single Field’ – but for some reason the lightbox doesnt seem to work properly…I managed to get the Thumbnail to show, however, the lightbox does not popup & link to the video…it also seems to be showing me results with the embedded video next to the thumbnail on the page…

    I then tested the Repeater, and im just getting a broken image…

    Unfortunately, my coding & debugging skills arent that great..by chance can you assist me alil further to hopefully get this working…

    This is the Field name im using for the Repeater: video
    This is the Sub Field im using for the oEmbed: video_url


    @EbbandFlow
    indeed your code is very comprehensive…ideally, if i can simplify it just for YouTube then that would be helpful…however, whatever we can do to make this work, would be great.


    @scheurta
    – I noticed yours is a simplified version, however, im still abit lost on how to put it together… :-/

    Any reply would be greatly appreciated.

  • No luck yet…I am hoping someone here can help with this…

  • Hi Navid..Thanks for the suggestion!…I went with ‘Responsive Lightbox by dFactory’ instead, since it was alil easier for me to install on wordpress…

    My only issue is I still cant seem to get the lightbox to popup for the Videos…Could it be the way ACF embeds the videos on the page?…

    The field type oEmbed is displaying the videos on the page like an actual youtube video player, and not as an image/video thumbnail…so, when I click on the video it just automatically plays from within the player on the page.

    Hmm, im abit confused on how to get an oEmbedded video to display in the lightbox…

    Is there a specific location in the_sub_field code that I should put rel=”lightbox” for this to work properly?

    Also, by chance is there a way that ACF can display the default Youtube Thumbnail image automatically?…if so, that would be helpful.

    Appreciate your help with this.

    Thanks!

  • Thanks Navid!…Your right, the repeater field helped.

    By chance, is there a way you recommend that I can have these embedded videos from ACF open in a lightbox?…instead of playing on the actual page.

  • Hi @elliot — This was solved, but just had one quick question related to this…The code above is working perfectly, but I noticed if I put the Photographers Name, without a URL — the Photographers Name will still be a hyperlink & it will reopen the same post page its on…Is there a way, that if I do not include a URL, that it will only display the Photographer name as plain text, and not as a hyperlink?

    Hope that makes sense. thanks.

  • Awesome..it Works!

    Thank you.

  • Hi @elliot,

    Thanks for the reply!….Actually, that was my fault – the photographer name doesnt use the repeater…Thanks for noticing that.

    Also, I think i need to clarify regarding the URL…I’m actually trying to have the name of the Photographer be a hyperlink to a specified url…Each post may have a different photographer….so, I may have something backwards in how I setup my field and code.

    Currently, in the admin for the post – I have the field to type the name of the photographer, but I assume I also need the option to include a URL associated the name.

    The field type that I am currently using is “Text”.

    Below is an example of the code I am using now, which does make the Photographers name clickable – but, now how do I associate a specific URL?

    I left a gap in the code on purpose, coz I assume that is where I fill in the missing code…right?

    <p class="image_photographer">Image Courtesy of: <a href="[URL FIELD CODE GOES HERE]; ?>" target="_blank"><?php the_field('image_photographer'); ?></a>

    Hopefully, you can see what I did wrong there, and what im trying to do

    Thanks!

  • Hii..thanks, i will look at this and hopefully see how to do…i just get confused with the way my code is setup…

    Is this ‘homepage Thumbnail’ the name of field type?

    'homepage-thumb' => __('Homepage Thumbnail'),

  • @treebeard – Ya, I am pretty much completely lost on this too…The only way I am able to get my images to display are by using “Image Object”…but, I think I read in order to do custom sizes you need to use “Image ID”….im hoping ACF Support can help tweak my code to get this to work.

  • Thank you very much for your help, I appreciate it!

  • Hi @elliot – sorry for the confusion & i appreciate your patience.

    Yes, that is exactly what I want to do.

  • I guess simply, my question is…How can I set the repeater to display in 2 columns without duplicating?

    Thanks.

  • Ya, thats my issue…I know im not doing it correctly, and its duplicating…but that idea is lets say I want to display 6 items from the repeater…instead of the 6 items being listed straight down 1 row….i want it to also display on the 2nd row…for example, item 1, 2, 3 on left, and then item 4, 5, 6 right.

    hmmm, hopefully kindda makes sense what i mean….i know im not setting something up properly.

    thanks!

  • Hi @elliot,

    Okay, I did a test by switching the page to another Template & inserted the Code above, and it worked!…so, with that – I went ahead & looked deeper into the original template page that I was having issues and finally noticed an extra ‘ <?php endif; ?>’ hidden in a line of code.

    So, things seem to be working properly now..thanks for your assistance..if i have any other questions, im sure ill ask. 🙂

  • okay, i set DEBUG_MODE to ‘TRUE’….and I do not get any Error or Debugging information on the page.

    Just so you know the Data results that I created in ACF are displaying & linking properly…but my page template loses its Sidebar, Footer, and the WordPress Admin Bar at the Top disappears (only on this specific page) — when I select Post_Object as the Field Type…it seems to only happen when I select Post_Object.

    Below is the code I used — I dont think this code is the issue, because even when I remove the entire code, it still doesnt show the sidebar, widget, and WP Admin bar….it only seems to happen when I select Post_Object in the sub field ACF settings: (in my case, “game_name” is set as Post_Object)

    <?php if(get_field('list_of_games')): ?>
      <?php while(has_sub_field('list_of_games')):?>
    
        <?php 
          $post_object = get_sub_field('game_name');
             
          if( $post_object ): 
          // override $post
          $post = $post_object;
          setup_postdata( $post ); 
        ?>
         <div>
           <ul>
           <li><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a</li>
           </ul>
              <span><?php the_sub_field('list_of_games'); ?></span>
          </div>
            <?php wp_reset_postdata(); // IMPORTANT - reset the $post object so the rest of the page works correctly ?>
        <?php endif; ?>
      <?php endwhile; ?>         
    <?php endif; ?>

    Any ideas?… :-/

    I appreciate your help. Thanks.

  • Hello..It worked based off the documentation & example above…and I am now able to list the Titles & they are linking properly….However, when its set to Field Type: Post_Object — I lose my entire sidebar & Footer from the template page that I am using the this on…

    When the Field Type is set on anything else – such as: Page_Link — then my page goes back to normal with the sidebar & footer on the page….but, obviously using Page_Link wont work the way I need it….

    Also, I am working Locally – so I even notice that the WordPress Admin bar at the top disappears….this is only occurring on this specific page, when using Post_Object as the Field type.

    Is there any explanation as to why I would lose my sidebar & Footer from the page, when using Post_Object?…I would appreciate any help possible to make this work.

    Please keep in mind, I am not a developer – so i appreciate the patience & assistance. 🙂 thanks.

  • *UPDATE – I just realized you mentioned “Post Object Field”…so, I tried that instead of “Page Link”…but setting it to “Post Object” gave me some odd error:

    ) SCREAM: Error suppression ignored for
    ( ! ) Catchable fatal error: Object of class WP_Post could not be converted to string in C:\wamp\www\site\wp-content\plugins\advanced-custom-fields\core\api.php on line 681

    Should I be using “Page Link” instead?

  • Hii..okay, i switched it from Text to Page Link.

    After I put the code in…I do get the URL to display a Link on the page…however, I notice it is listing the Full URL – instead of the actual name of the games….can we have it display the game name, as the link?

    Also, the links are not actually working — when I click on them or hover over them I notice that they are pointing to the current page they are on…and not the actual URL address that they are suppose to go to.

    Hopefully, you know what i mean…im fairly new, so im trying to explain it easily. 🙂

    Thanks.

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