Y
Y
Yaroslav2017-07-24 15:52:09
WordPress
Yaroslav, 2017-07-24 15:52:09

Why are custom acf fields not being passed to the main page of the store?

Something I'm dumb.
I can not display custom fields on the main page of the store.
Everything works fine on the category and product pages.
The code is like this:

<?php if ( is_shop() ) { ?>
11
<?php $value = get_field( "stickytext" );
if( $value ) : ?>
<div style="height: 100%;position:relative;background-color:<?php the_field('stickycolor'); ?>;">
               <div style="margin: 0 auto;padding:10px"> <?php the_field('stickytext'); ?></div>
                </div>
<?php endif; ?>
<?php } ?>

11 is output, fields are not.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Maksym Davydchuk, 2017-07-24
@Yaxoo

You need to specify the id of the field, and if the field is from the settings page, then you need to specify 'option'.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question