You are saving your extra fields to the *_options
table so you need to pull them back out of that table. You can copy and cobble together bits of the existing code to do that.
if ( is_category() ) {
$current_cat = get_query_var('cat');
}
$tag_extra_fields = get_option(MY_CATEGORY_FIELDS);
// var_dump($tag_extra_fields); // debug
if (isset($tag_extra_fields[$current_cat])) {
var_dump($tag_extra_fields[$current_cat]);
}
Of course, you don’t really want var_dump
. You will want to echo proper markup. I don’t know exactly what markup, but that should get you started.
For example, to output the title as an <h1>
tag:
echo '<h1>'.$tag_extra_field['my_title'].'</h1>';
This is assuming that I have interpreted the array structure correctly. If that doesn’t work uncomment the var_dump
line and post the output in the question– code formatting in comments is almost non-existent.