Support

Account

Forum Replies Created

  • Not sure if this is what you’re after, but I did something similar on my own site:
    http://sethquittner.com/sqd/portfolio/print-projects/

    To get unique IDs I added a counter called $divNumber to the while loop

    Here’s the PHP:

    <?php
        
        $divNumber=1;
              if( have_rows('sqd-print') ):
                 while ( have_rows('sqd-print') ) : the_row();?>
            <article class="sqd-prints">
            <a href="javascript:toggleDiv('sqd-print-<?php echo $divNumber; ?>');">
                <div class="sqd-print-entry">
                  <img src="<?php the_sub_field('thumbnail');?>" alt="">
                  <span class="print-title">
                    <?php the_sub_field('print_title');?>
                    </span><br>
                  <span class="print-caption">
                   <?php the_sub_field('print_caption');?>
                  </span>
                <i class="fa fa-chevron-circle-down" aria-hidden="true"></i>
                </div>
                <div class="clearfloat"></div>
            </a>
            <div id="sqd-print-<?php echo $divNumber; ?>" class="entry-content hidden sqd-print-lg">
              <img src="<?php the_sub_field('print_image');?>" alt="">
              <i class="fa fa-times-circle" aria-hidden="true"></i>
            </div>
        
            </article>
            <?php
              $divNumber =$divNumber  + 1;
              endwhile;
             else :
             endif;
    ?>

    and the jQuery (which you’ll need to enqueue):

    function toggleDiv(divId) {
         jQuery("#"+divId).slideToggle('2000',"swing", function () {
           jQuery(this).parent().siblings().children().next().slideUp("slow");
          });
         jQuery('.sqd-print-lg .fa,.entry-content').click(function() {
            jQuery("#"+divId).slideUp("slow"); 
    
        });
      };

    I used Font Awesome icons
    and a screenshot of my ACF is attached. You can ignore the video sub field.

    Hope this Helps.
    –Seth

  • This reply has been marked as private.
  • Hi James,

    I appreciate the suggestions and tried all of them and even tried turning the ACF plugin off and on again. The problem persists.

    Thanks for taking the time,
    Seth

  • Thanks John!

    I’d been copying and pasting from a pdf in MAC’s Preview program. It never occurred to me that extraneous markup was stowed away. I should’ve checked the Text view of the WYSIWYG as well.

    Glad to know that it was operator error.

    –Seth

  • 1 year and 3+ months later….

    Hello – I just had this problem with Flexible Content, too. I can’t really see a pattern with it. It occurs on WYSIWYG editors and I get the same markup as mladen.

    <div class="page" title="Page 1">
    <div class="section">
    <div class="layoutArea">
    <div class="column">

    Does anyone know what’s causing this and how to avoid it?

    Thanks,
    Seth

  • @theatereleven

    I’ll be creating the pages and accounts for this particular project, so it’s simpler than what you’re doing. But another project requires user-driven account creation and we’re using Gravity forms as well…so we’ll look into your solution.

    I also thought that BuddyPress would do all of this…surprising that it doesn’t.

    Good to know about Tabby Tabs…looks useful.

    Thanks again!
    Seth

  • Thank you @theatereleven! Generous of you to post this info and I appreciate it. Will give this a try.

    Just yesterday I found another plugin that seems to solve most of the problems: It’s called Press Permit: http://presspermit.com/
    It’s very sophisticated and it gives you lots of control over user privileges.

    Thanks again,
    Seth

  • Thanks for your reply @Hube2. I’m still not clear on how to fulfill my requirements, though. Maybe I haven’t explained my problem well.

    If anyone else has suggestions, I’d appreciate it.

    Thanks,
    Seth

  • Thanks Elliot. This makes sense. I solved my immediate problem with a logic work-around, but this would be a great thing to know how to do for future projects.

    Best,
    Seth

  • Since you’re using posts instead of pages, there needs to be a way to filter only the posts that you want (In this case, Band releases). The post object is probably the way to go. Also look up post objects in the WordPress codex to see what data type you can access.

    Sorry I can’t be of more help here.

  • I just had a similar problem where I wanted to pass data from one page template to another. I connected the 2 pages via drop down menu of all the pages on the site. In your case, your drop down menu would accommodate posts instead of pages.

    If I understand your problem, you want to avoid adding duplicate info on your ARTIST post because it’s already been entered on the RELEASES post. So you could enter the data on the RELEASES post and then connect to the RELEASES post by using a drop down menu on the ARTIST post.

    Here’s what worked for me– thanks to Jamie and Elliot for showing me how to do this.

    and here it is copied from that bulletin board page:

    Get field data from another page via drop down menu:

    Page A (master page)
    Page B (sub-page): Linked to Page A via drop-down menu

    Create a post object field on Page B’s ACF called ‘select_page’

    In order for Page B to access field data from Page A:

    Add something like this in Page B’s php code:

    <? $pages = get_field('select_page');
        get_field('content_from_page_A', $pages->ID);
    ?>

    You can have as many get_field(‘content_from_page_A’, $pages->ID) as you need where ‘content_from_page_A’ is the name of any field on the RELEASES template and $pages->ID gets the page ID number of the RELEASES page as defined by the drop down menu of pages (or posts in your case).

    $pages->ID is what hooks the two templates together. If we weren’t using a variable, the syntax would look like this:

    get_field(‘content_from_RELEASES_page’, ID of RELEASES page)

  • Thanks Jamie and Elliot. This answered my question

    For anyone else interested in passing field data between pages while using a drop down menu to connect the pages together, here’s one way to do it:

    Get field data from another page via drop down menu:

    Page A (master page)
    Page B (sub-page): Linked to Page A via drop-down menu

    Create a post object field on Page B’s ACF called ‘select_page’

    In order for Page B to access field data from Page A:

    Add something like this in Page B’s php code:

    <? $pages = get_field('select_page');
        get_field('content_from_page_A', $pages->ID);
    ?>
Viewing 12 posts - 1 through 12 (of 12 total)