Hello,
The ACF Extended Post Type Archive feature save the field values in the post id {post-type}_archive
instead of option
.
To retrieve field data, you have to use get_field('my_field', 'my-post-type_archive')
.
Regards.
Hi Konrad,
thanks for clearing that up! Do you have any plans on expanding the documentation of your project beyond the description in the plugin directory?
Best regards
Christoph
Hello,
Absolutely, and I can also tell you that I’m currently working on it 🙂
It should be out during the summer!
Have a nice day.
Regards.
Great, good to know! Thanks for your great work with this plugin!
BTW,
In your Post type Archive & Single template files, you can use the following code in order to automatically retrieve fields from the Archive options Page:
<?php if(have_archive()): ?>
<?php while(have_archive()): the_archive(); ?>
<?php
// Retrieve 'my_field' from 'my-post-type_archive' Archive Page
$my_field = get_field('my_field');
?>
<?php endwhile; ?>
<?php endif; ?>
When you’re inside that while(have_archive()): the_archive();
loop, you don’t need to add the Option Post ID, like that get_field('my_field', 'my-post-type_archive');
.
It will be automatically added for you!
Regards.
Hi!
Is it possible that these custom fields can be displayed within templates created in elementor? I can currently apply a file template, but custom fields are not shown through Elementor dynamic options unless I build a shortcode to show them.
Regards
And another question, how to add Rankmath metabox for this admin page anchage Archive label to a custom label name ?
-
This reply was modified 3 years, 9 months ago by sermalefico.