As from here I can see you used a parameter on your cat_sub_title() function but I don’t think you echo manually. you just hooking this function. That’s why it’s not working.
Try like this. and there is no need to pass any parameter but if you do please working with that.
add_action('genesis_before_loop', 'cat_sub_title', 5 );
function cat_sub_title() {
$term_id = get_queried_object()->term_id;
$catsubhead = get_term_meta( $term_id, 'cat_headings_cat-sub-heading', true );
if ( is_category() ) {
if ( $catsubhead ) {
printf( '<h2 class="sub-heading">%s</h2>', $catsubhead );
}
}
}
Hope it makes sense.
Related Posts:
- Registering Class methods as hook callbacks
- When does WordPress.org notify sites of new version?
- Get a button for in the Editor
- wordpress get meta value by meta key
- How to create gutenberg block using REST API independently or as headless way?
- Updating WordPress – the best approach (updating wp core, plugins and db)
- Code markup plugin like the .wordpress.com blogs offer?
- Set active theme via URL
- WooCommerce Always Include Shipping Information in Checkout [closed]
- Bad Request (Invalid Hostname) on working server, database problem
- Plugin Not Working, But Only On GoDaddy Hosted site
- Long running action from plugin
- How to get the current plugin name?
- Errors while using ajax from external wordpress page
- List of plugin updates in admin bar
- Custom field in TWIG template – Advanced custom fields plugin
- Peer Review Plugin for Posts? [closed]
- Server side validation for Contact Form 7 [closed]
- Bulk Image Uploader to create new post from each image [closed]
- How can I implement a notification system in wordpress?
- Internationalization: Not loading plugin translated text
- Building an email signup form. Where should the information be saved in the DB?
- How do action and filter hooks understand where to look for the core function that we hooked our function to them
- Bootstrap Drop Down menu is not working
- Plugin Code ONLY on Post Edit Page
- qTranslate conflicts with SEO-plugins [closed]
- Ajax fail and get 504 error
- Want to Show Sub categories under Categories section using Woo Commerce [closed]
- How to customize the grid layout in reactive pro wordpress plugin [closed]
- How to run subversion and staging environments when running WordPress
- Subdomains with almost the same content
- What does making sure “that your theme is WordPress header and footer tag enabled” mean?
- check if a file in a plugin folder exists from a locale installation
- WooCommerce: Disable Taxation for Specific Address [closed]
- Move plugin-settings to ‘Settings’-menu in the admin
- Installing wordpress on a subdomain of an already existing static website
- Slashes stripped in ACF
- How do I add some javascript validation to the admin interface form’s onsubmit?
- Login problem after installing my written plugin [closed]
- Can deactivating a plugin sometimes “reset” settings within that plugin?
- remove all submenus from plugin
- Hook for page Request?
- How to do database for download stats?
- Comment IP Plugin – Fixing onfocus=’this.select()’
- Plugin Admin Menu Boiler Plate
- WordPress permissions error with admin account
- Get post content from outside the loop with plugin shortcode usability
- Adding option values as an array using a multi selectable select box
- How to set the default value as the saved value once a form of widget is saved?
- Custom post type change excerpt more and excerpt length
- Example for use tinymce in wordpress 3.5.1?
- Dynamic Image Replacement through call rail phone call tracking plugins in wordpress
- Advanced custom fields and Slideshow gallery desn’t work together? [closed]
- How can I show registration form inside modal?
- Replace video url with video player
- How could I fix the lowercase problem in nextgen gallery? [closed]
- Publishing a video from blog to youtube
- Need to edit author permissions | custom taxonomy
- Custom Logo Link WordPress
- Where do I put the code snippets I found here or somewhere else on the web?
- WP Import All Multiple Dynamic Link Imports
- admin_notices show after load completed
- Error in Fetching Custom Post Type parent Category URL (slug)
- is there a way to display product gallery images via cdn
- Changing the Default New User Notification Email
- WP Fastest Cache -> Render Blocking Js -> Exclude Js Sources
- function post to trash problem
- How to call function in WordPress on button click?
- How can I see $post object in frontend from functions.php?
- WordPress site hamburger menu toggle not working
- save short-code in my custom plugin settings problem missed something
- WordPress website working fine on localhost but not displaying front pages on webhost
- Change WordPress plugin widget `id_base` without breaking widget
- Uploading website to live causing problems to plug-in and layout
- How is it possible to create Multi part sections where people can answer or comment or vote on various parts of a page’s content as given example?
- save multi-select input using update_option for plugin
- Capture Recaptcha fail event on Contact Form 7
- register_activation_hook not creating table
- How can I share my wordpress site with a friend?
- Making sure updates didn’t break anything
- wp_schedule_event function reference
- Meta box or shortcode help
- Users Ultra: Hide asterisk for required registration fields?
- Adding HTML to the search page
- Retrive images from the_content()
- How to retrieve hashtaged tweets from a list of users and post to WordPress
- Multi-step, live updating search
- Turning Existing Eccommerce Site into Multi-SIte
- wordpress select multiple options and illegal string offset ‘timeslot’ [closed]
- post_exists() returns a 0 but the 0 doesn’t register [closed]
- Display HTML5 jQuery Audio Player On Front Page
- How Do I Add Product Pictures To Search Results Of A Custom WordPress Theme Using A WooCommerce
- Is it possible to add permalink when using wp_insert_post?
- Update Plugin of wordpress to specific version
- Can WordPress updates take down site functions?
- How to get custom setting from get_option and pass it in getEntityRecords in gutenberg block?
- When to store store plugin options as a single database record?
- What is the best way to override functions of thirdparty plugins?
- How to move a post in Vacancies so it appears in News/Events?
- Can’t install plugins