duanrang2627 2014-12-10 17:52
浏览 49

高级自定义字段未显示转发器

Hello so i have had problems showing ACF fields because of an custom plugin. I did then find out that i can instead write:

<?php $outputtext= get_field('text'); ?>
<?php echo $outputtext; ?>

instead of

<?php get_field('text'); ?>

because this didn't work when plugin was activated.


So i have been searching for an answer for a while now and been testing the same way i did get fields to also show an repeater to. No success...

And yes i have been testing regular code wich is

    <?php
    // check if the repeater field has rows of data
    if( have_rows('topp_yrken_referenser') ):
        // loop through the rows of data
        while ( have_rows('topp_yrken_referenser') ) : the_row(); { ?>

            <div class="col-xs-12 col-sm-4">
               <blockquote>
                    <?php // display a sub field value
                    the_sub_field('topp_yrke_referens');
                    ?>
               </blockquote>
            </div>


       <?php } endwhile;
    else :
        // no rows found
    endif;
    ?>

This is how it worked before the custom plugin and stopped to work

  1. How do i make something like this work like i made work with this instead?

  2. Is there an name for this $this= get_field('text'); ?

  • 写回答

1条回答 默认 最新

  • duannv2081 2014-12-10 20:39
    关注
    <?php if (have_rows('topp_yrken_referenser')){ ?>
         <?php while (have_rows('topp_yrken_referenser')) { the_row(); ?>
         div class="col-xs-12 col-sm-4">
                   <blockquote>
                        <?php the_sub_field('topp_yrke_referens'); ?>
                   </blockquote>
                </div>
         <?php }; // while:   ?>
        <?php }; ?>
    

    This is as barebones as the code can get.

    评论

报告相同问题?

悬赏问题

  • ¥15 基于FOC驱动器,如何实现卡丁车下坡无阻力的遛坡的效果
  • ¥15 IAR程序莫名变量多重定义
  • ¥15 (标签-UDP|关键词-client)
  • ¥15 关于库卡officelite无法与虚拟机通讯的问题
  • ¥15 目标检测项目无法读取视频
  • ¥15 GEO datasets中基因芯片数据仅仅提供了normalized signal如何进行差异分析
  • ¥100 求采集电商背景音乐的方法
  • ¥15 数学建模竞赛求指导帮助
  • ¥15 STM32控制MAX7219问题求解答
  • ¥20 在本地部署CHATRWKV时遇到了AttributeError: 'str' object has no attribute 'requires_grad'