Hi there,
Thanks for posting in.
Your code is working, but it’s different from your screenshots (maybe you already added some changes). But if it’s just about centering, then you could do that through container’s flex layout.
- Inspect your headline bar’s container
- Change the Self Flex’s Preset value to Fill Space Equally
- Change your Flex Layout’s Horizontal to Center
That should center it, please note that your title will not be displayed on non-category page ( single_cat_title()). You should use a conditional statement and display static text for the blog, and standard title for portfolios. Example,
add_shortcode('my_cat_title','get_my_cat_title');
function get_my_cat_title ( ) {
if ( is_category() ) return single_cat_title();
if ( is_home() ) return 'THE BLOG';
if ( is_singular('x-portfolio') ) return get_the_title();
}
Hope this helps.