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.
Related Posts:
- How can i list current author’s categories?
- anything like add_meta_box for categories?
- How do I update a field of a meta box?
- Redirect to another page using contact form 7? [closed]
- Function/Class to list categories with checkboxes
- Customise Grouped Product display in Woocommerce with custom column
- Override class inside $atts shortcode_atts in WordPress
- get_posts() not working when accessing with a custom user role
- creating custom function to log actions in plugin
- Is it possible to change a term slug before being saved to the database?
- add_rewrite_rule works in themes function php but when moved into plugin it stops working
- Swapping wp_dropdown_categories function with wp_category_checklist
- Maximum lifetime for nonce
- Where can i find wordpress auto update code flows?
- Custom Taxonomy to dropdown box on adminside wordpress
- wp_insert_category() setting the ‘cat_ID’ gives not array error
- Adding option to Gallery shortcode
- Create & Save multiple Meta-boxes
- Saving value of a selection option in comment form as comment meta
- correct way to call javascript into hook function
- Strange issue saving custom field data for a WooCommerce order
- How to change the hover content of a specific menu item on WordPress?
- Woocommerce – Convert Delivery method into a custom field
- how to search users by ajax live search
- Send push when new post is published in a certain category
- Remove unwanted elements for a wp_nav_menu
- How to get Metabox custom field to show checked if value is updated using post meta query?
- Input value from metabox is not found in $_POST after post save
- Run Shortcode of post’s custom field in functions.php / Plugin
- How do I get the sub categories of the parent when in a sub category?
- How to add user details to different tables immediately after user registration
- mysql_real_escape_string() vs. esc_sql() in WordPress
- Custom code for WordPress dynamic menu
- WordPress function get_the_terms() returns ‘Invalid taxonomy’ error
- Checking for existence of a page by title?
- how to get context information inside my funcion
- Filter Categories widget to allow custom sorting?
- WordPress class, using add_action to call member function does not work
- How to modify files inside wp-includes directory in wordpress
- Fatal error: Call to a member function get_page_permastruct() on a non-object
- wp_get_post_terms Order by not working
- Checked() function on a multidimensional array
- What is the best way to store a few fields?
- wp_get_theme Warning: Illegal offset type
- Delist entries in the_loop
- Why wp_die() doesn’t work with wp_redirect but exit() works
- Remove entire [$key] from array stored in custom field using Ajax – unset($array[$key]); not working
- How can I add a simple custom field to my plugin?
- Ajax is not working in a loop
- Warning: call_user_func_array() expects parameter 1 to be a valid callback
- Print Dashboard submenu name and filename
- Autogenerate a Table of Contents
- ACF in wordpress
- Alternative functions for mysql_free_result and mysql_ping in wordpress functions
- WordPress multisite,use same cookies across all website?
- How can I show posts for a single category?
- Apply styles to blockquote element with the WYSIWYG editor
- Check if post belongs to any category
- Call to undefined function is_home() or any conditional tags
- Custom meta box values are not getting saved for my custom post type
- unregister_setting() vs delete_option() for plugin update
- How to change WooCommerce loop product title HTML output in single product page and archive page
- How to save post meta as an array in Gutenberg?
- How to display the categories on page using shortcode?
- How to display the category id along with category name on categories list?
- Issues Updating Post Meta with AJAX (Seems simple but cannot figure it out)
- per blog metadata for plugin
- add_action pre_term_description vs. pre_category_description
- How to output functions from plugin inside theme
- wp_schedule_event is registered but function isn’t running
- How to format custom fields when editing an attachment?
- How to show parents of current page category, excluding the category?
- Custom post type in Custom widget – $listItem
- Overwriting a plugin function
- WP Dropdown Categories, display subcategories but not grandchildren categories?
- Writing editor content to a file
- Any way to update_post_meta with html content? It gets stripped and becomes empty
- Load stylesheet in edit category page?
- How to relate the Category to user?
- How can i listing current category and Featured Category post list?
- Remove Permalink Meta Box not working?
- Adding tables to dashboard pages programmatically?
- How to exclude categories from get_categories() select list inside a widget admin panel
- Setting post_id for single.php based on URL without a redirect
- using admin functions on frontend
- Javascript Function Called Too Early in PHP Script
- Modify code for functions.php with specific twitter user url and hashtags
- can’t access some WordPress function from my plugin
- How to Show Category List With Corresponding Links?
- WP 3-way voting system: On to something! Please help!
- how to add custom fields into new & update post page?
- Custom Settings Plugin Save foreach checkboxes
- Exclude Woocommerce Product Category From Sitemap
- Change the behaviour of a button
- Can someone explain what’s the use of parse request function in WordPress?
- How to show only the last two categories in a menu?
- Add default value from selection
- function add custom fields to media gallery
- Determine if term is Category or Tag
- Override category archive page title (not the head title)