Support

Account

Forum Replies Created

  • I also have the same problem. I am using the normal default Gutenberg editor for WordPress 5+ and I am creating a custom set of options for the front page and selecting the “Hide on screen -> Content Editor” does not work.

    Is this going to be fixed any time soon?

  • For some reason the code did not work. I did find the following code that did work.

    add_action('acf/save_post', 'flex_FeaturedImageSetByACF', 50);
    
    function flex_FeaturedImageSetByACF() {
    
        $current_screen         = get_current_screen(); // Current admin screen needed to identify the current cpt
        $current_cpt_name       = 'models'; // Current cpt name
        $current_cpt_support    = 'thumbnail'; // We want to check if the CPT supports this feature
    
        global $post;
    
        $post_id                = ( $post->ID ); // Current post ID
        $post_gallery_field     = get_field('model_gallery', $post_id ); // ACF field
    
        if  ( !empty( $post_id ) ) {
    
            if ( isset( $post_gallery_field['0'] ) ) {
    
                $post_image_id          = $post_gallery_field['0']['id']; // ACF image filed ID
                $post_image_url         = $post_gallery_field['0']['url']; // ACF image filed URL
    
                // If current cpt supports thumbnails/featured images
    
                if ( post_type_supports( $current_cpt_name, $current_cpt_support ) ) {
    
                    if ( ( $post_image_url ) AND ( ( $post_image_url ) != ( get_the_post_thumbnail() ) ) ) {
    
                        update_post_meta($post_id, '_thumbnail_id', $post_image_id);
    
                    }
    
                }
    
            } else {
    
                update_post_meta( $post_id, '_thumbnail_id', 0 );
    
            }
    
        }
    
    }
  • Ok, thank you John. I will try your “easier method” first.

  • Thanks John, it’s working. Very much appreciated.

  • I have the relationship field set to use the Post ID.

    Here’s my code where I need the variable “$theids” at line 8 to output the post id’s:

    <?php 
    $theids = get_field(post_id_one);
    $latest_title = get_field(latestposts_title);
    if( get_field('show_posts') )
    {
        echo '<div class="container"><div class="acsc-outer">
    <div class="fancyheader"><span class="acsc-title">' . $latest_title . '</span></div>
    </div>' . do_shortcode( '[display-posts include_excerpt="true" id="'.$theids.'"]' ) . '</div>';
    }
    ?>
  • Solved it with this: slideshowSpeed: [ “<?php the_field(‘set_carousel_speed’, ‘option’); ?>”]

    The complete code:

    // Initialize Slider
     
        function agencyclix_slider_initialize() { ?>
            <script type="text/javascript" charset="utf-8">
                jQuery(window).load(function() {
                    jQuery('.flexslider').flexslider({
                        animation: "slide",
    					animationLoop: true,
    					itemWidth: 283,
    					itemMargin: 0,
    					minItems: 1,
    					maxItems: 4,
    					move: 1,
    					touch: true,
    					pauseOnHover: true,
    					slideshowSpeed: [ "<?php the_field('set_carousel_speed', 'option'); ?>"]
                    });
                });
            </script>
  • Thank you Dalton,

    I have checked it out and it does look very interesting. I maybe purchasing it if the need comes up for any further custom column issues.

    The export to php feature makes it very nice for developer’s in fact that’s why I purchased ACF Pro (the export to php feature).

  • Wow, sorry for that. It was the uppercase “F” and yes the code:

    if(get_field('featured')) {
    echo 'Yes';
    } else {
    echo 'No';
    }

    does work. Thanks Mediawerk

  • WOW! it works. You did it! Once again thank you Mediawerk. 🙂

    PS: I tried editing the original post but the ‘Edit’ option does not show up so I could not fix the formatting. I emailed support asking them about it but did not receive anything back.

  • I have the images and all text showing up using the repeater sub fields now.

    The slider show’s only one slide (the first slide only).

    I’m thinking it has something to do with the indicators and the counter for the indicators. I don’t know if I have that part properly formatted.

    Here’s the code:

    <div class="carousel fade-carousel slide" data-ride="carousel" data-interval="4000" id="bs-carousel">
      <!-- Overlay -->
      <div class="overlay"></div>
      
    <ol class="carousel-indicators">
     <?php while(the_repeater_field('slideshow_images')): ?>
    <?php $i = 0 ?>
    <?php 
    if ($i == 0) {
    echo '<li data-target="#bs-carousel" data-slide-to="0" class="active"></li>';
    } else {
    echo '<li data-target="#bs-carousel" data-slide-to="'.$count.'"></li>';
    }
    $i++
    ?>
    
    </ol>
    
      <!-- Wrapper for slides -->
      <div class="carousel-inner">
     
      <?php $z = $z + 1; $image = wp_get_attachment_image_src(get_sub_field('image'), 'full'); ?>
    
        <div class="<?php echo ($z==1) ? 'item slides active ' : ''; ?>item slides">
      
        <div style="background: url(<?php the_sub_field('image'); ?>);max-height:500px;height: 100%; background-size: cover; background-position: center center; background-repeat: no-repeat;"></div>
          <div class="hero" style="width:96%;">
            <hgroup>
                <h1><?php the_sub_field('title');?></h1>        
                <h3><?php the_sub_field('sub_title');?></h3>
            </hgroup>
            <a href="<?php the_sub_field('image_links_to'); ?>"<button class="btn btn-hero btn-lg" role="button"><?php the_sub_field('links_to_text'); ?></button></a>
          </div>
        </div>
      </div>
    <?php endwhile; ?>
    
    </div> 
  • Yes, Mediawerk. Thank you so much. it works.

  • Thanks MediaWerk but my problem is mostly with the code for adding a counter and applying a class of “active” to the first slide and indicator.

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