Support

Account

Home Forums ACF PRO Show HTML in Options page

Solved

Show HTML in Options page

  • I create an option page but when I try to display the data, just can see that info and not any other HTML code.
    Here the example:

    
    <?php if( the_field('phone', 'option') ): ?>
    <li><?php the_field( 'phone' ); ?></li>
    <?php endif; ?>

    The result is just the phone (ex: +1 2345 6789) but not the <li></li>

    Any idea?

    Thank you very much

    Rod

  • The field echos the field, the first on is echoing the field and the second is echoing nothing because it’s missing the ‘option’ argument.

    I’m guessing that with you’re probably seeing is

    
    +1 2345 6789
    <li></li>
    

    try

    
    <?php if( get_field('phone', 'option') ): ?>
    <li><?php the_field( 'phone', 'option' ); ?></li>
    <?php endif; ?>
    
  • Thank you John, work perfect!

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

The topic ‘Show HTML in Options page’ is closed to new replies.