Hello, I’m yust saying that I can’t access to grid template (because of html array) as I can on product/single cruise template so I must access with jquery to add this field to grid template and I don’t know why doesn’t work…
Hello,
thanks but I create date and another custom field which works in product:
http://wp.swlabs.co/exploore/cruises/alaska/
and now I want show this field also in grid: http://wp.swlabs.co/exploore/cruises/
Post type for cruises is only one in ACF: sizexploore_crusie.
I add manualy to product template:
<div class="class_field">
<?php if( get_field('custom_field') ): ?>
<h4>Somme text: <?php the_field('custom_filed'); ?></h4>
<?php endif; ?>
</div>
But can’t add it on grid template, because of printf formated %1$s, %2$s, %3$s which don’t accept php because is html array, so I try to add this field to price with jQuery …
Hello,
thanks for answer,
I try now:
function pw_load_scripts() {
wp_register_script('pw-script', get_template_directory_uri() . '/assets/public/js/custom_filed.js', array('jquery'));
wp_localize_script('pw-script', 'pw_php_vars', array(
'custom_filed' => custom_filed
)
);
wp_enqueue_script('pw-script');
}
add_action('wp_enqueue_scripts', 'pw_load_scripts');
and still getting text custom_field instead of value. Is maybe problem with jquery?
I try with append and html
Thanks for help,
A