Add Description at the end of Tag or Category Pages

Hi,

is there a way to add a custom field to each category ot tag page?

For example:

You can see that I have a description at the top of the page.
Then I have all posts from that category

And now I like to add some more text at the end of the site.

How can I do this?

Michael

Hi there,

Thanks for posting in.

You may check it here https://www.advancedcustomfields.com/resources/adding-fields-taxonomy-term/, and you may add your custom fields to your category and tag taxonomies.

And to display it, you may add this code to your child theme’s functions.php with your custom field

add_action('x_after_view_global__index', 'display_taxonomy_field');

function display_taxonomy_field () {

if( !( is_tag() || is_category() ) ) return false;

$term = get_queried_object();

$field1 = get_field('your_field_name1', $term);
$field2 = get_field('your_field_name2', $term);

echo $field1;
echo $field2;

}

Thanks!

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.