Again: Ethos, Blog page and Portfolio Page Missing Header

Hi there,

I am stuck.
I follow this thread:

If I use the code, my header is messed up (text is overlaying my header and menu).
If I try a simple shortcode with:

add_shortcode('my_cat_title','get_my_cat_title');

function get_my_cat_title ( ) {
    return single_cat_title();
}

I get the title, but no matter what I do, I can’t format the typo.
Any help please?

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.

  1. Inspect your headline bar’s container
  2. Change the Self Flex’s Preset value to Fill Space Equally
  3. 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.

Hi Rad,

of course its different from the screenshot. I am not “pkingco” I just followed his thread and solution :wink:

It’s not really working.
Still the Problem: I can not format the shortcode. I have
/ Here is my Title: [my_cat_title]
Expect to see:
/ Here is my Title: Pressemitteilung
But see:
Pressemitteilung / Here is My Title:

E.g. On the right hand you should see the menu “News & Mediathek” -> “Pressemitteilungen”

Thank you,
Michael

Hi there,

The problem is that the code you have for the shortcode just throws the name of the title without the surrounding HTML tags.

I moved out the shortcode section from the headline that you had and added another headline with the shortcode and it worked:

Thank you.

Hi there,

I tried this also before. Unfortunately I can’t format the text even with this workaround.
No matter if I try to change the color, font-weight or size in the native text item (or headline item), or if I try to format the text via html in the text box himself…
I would like to see “Pressemitteilung” in the same font and weight as “Here is my title:”

Thank you,
Michael

Hi there,

I see now, please change this line single_cat_title(); with this single_cat_title("", false);. That should work now.

Thanks!

Perfect!
Thank you for a great support :slight_smile:

Glad to see we managed to help!

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