Answer the question
In order to leave comments, you need to log in
How to display custom ACF fields in Wordpress tags?
Greetings.
Task - Display a custom field (heading h1) for tags in WP. If the field is filled, display it, otherwise the standard name.
I don’t know if the topic is to blame or not, but I didn’t try everything in the end on the records - ok, on the categories - ok, on the tags - no.
For categories, this option works -
$title = get_field('h1', "category_".get_query_var('cat')) ? get_field('h1', "category_".get_query_var('cat')) : single_cat_title('', false );
Help to draw the correct output for the tags.
Thank you.
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question