Skip to content
Advertisement

Get parameter of shortcode in Insert PHP Code Snippet plugin using ACF repeater

Everybody hello! I’m sorry for asking such kind easy question, I’m pretty new at this. I have problem with transfering parameter value and echoing it to itself.

PHP code snippet on page: [xyz-ips snippet="Generating-content" paramSet="1"]

Inside ‘generating content’:

<?php if( have_rows('information') ): ?>
   <?php while( have_rows('information') ): the_row(); ?>
      <?php $sub_value = get_sub_field('number'); 
         if($sub_value == 1): ?>
            <div class="d-block d-md-flex d-lg-flex">
               <img src="<?php the_sub_field('image'); ?>">
                  <div>
                     <?php if( have_rows('repeatable_content') ): ?>
                        <?php while( have_rows('repeatable_content') ): the_row(); ?>
                           <p>
                              <?php the_sub_field('text'); ?>
                           </p>
                        <?php endwhile; ?>
                    <?php endif; ?>
                </div>
            </div>
        <?php endif; ?>
    <?php endwhile; ?>
<?php endif; ?>

Right now I need to change condition if($sub_value == 1) to if($sub_value == "PARAMETER VALUE")

Please help, guys!

Advertisement

Answer

Thank you guys for helping! The main issue of this problem is that you have to buy premium version of this plugin, your version is working in another plugins 🙂

Working plugin’s name: Shortcodes Blocks Creator Ultimate

User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement