• Resolved markroth

    (@markroth)


    Generatepress is no longer showing post/page titles.

    I haven’t touched the code recently.

    Is there a setting I need to check/uncheck?

    I have searched and searched to no avail, so I’m turning to you here for help, please.

    Thank you.

    The page I need help with: [log in to see the link]

Viewing 12 replies - 1 through 12 (of 12 total)
  • Leo

    (@leohsiang)

    Hi there,

    Can you make sure Content Title is not disabled here? https://docs.generatepress.com/article/disable-elements-overview/

    If not can you try disabling all plugins to test?

    Thread Starter markroth

    (@markroth)

    Thank you, Leo.

    I’m a “cheapskate” — I don’t have GP Premium nor do I have the Disable Elements add-on. (And individual posts do not have Content Title checked.)

    I renamed the plugins folder. Made no difference.

    I guess I can just put content-single and content-page in my child theme with the appropriate line(s) removed or at least commented out.

    Unless there’s a way to correct this with less mess.

    Thanks again,
    Mark

    Theme Author Tom

    (@edge22)

    Do you already have those custom files (content-page.php and content-single.php) in your child theme?

    If so, what about them did you customize?

    Thread Starter markroth

    (@markroth)

    Nope. I do not have those custom files in my child theme.

    Theme Author Tom

    (@edge22)

    And I assume the actual page has a title in the page editor?

    Thread Starter markroth

    (@markroth)

    Good assumption. ??

    This isn’t a problem on just one page. As far as I know, it’s on all pages and posts.

    For example, https://www.clpcle.com/products/the-work-of-his-hands/ should show The Word of His Hands as the post title. I look at the code and here’s the pertinent portion:

    <header class=”entry-header”>
    </header><!– .entry-header –>

    Titles are obviously stripped by default. And apparently just as obviously, there’s no setting to change. So the next obvious thing is the solution: I’ll just use custom content-single and content-page files in my child theme. ??

    Thank you again for engaging me here on this issue. I really appreciate that.

    Thread Starter markroth

    (@markroth)

    Unless there’s a fix I can put in the functions.php file…

    Theme Author Tom

    (@edge22)

    That’s the thing, the code already exists: https://github.com/tomusborne/generatepress/blob/2.0/content-page.php#L28

    So something is altering the_title() function output on your site. Perhaps it’s a plugin you’re using?

    Thread Starter markroth

    (@markroth)

    Thank you, Leo.

    Yeah, I know about the code you mention above.

    This line of code is the “culprit”:
    if ( generate_show_title() ) : ?>

    That’s what I intend to comment out in my custom pages. Then it will work. I know that already. I just didn’t want to have to go that route if there was a setting I couldn’t find. There isn’t, so that’s that. ??

    No, I’m sure it’s not a plugin issue. As I noted yesterday, I disabled all my plugins and it did not resolve the problem.

    Theme Author Tom

    (@edge22)

    There’s no need to comment that line out – it’s false by default, and it’s filterable.

    You can force it to be false like this:

    add_action( 'after_setup_theme', 'tu_force_show_title' );
    function tu_force_show_title() {
        add_filter( 'generate_show_title', '__return_true', 100 );
    }

    However, if that line was the issue, the empty <header> element wouldn’t be showing up.

    Thread Starter markroth

    (@markroth)

    Thank you, Tom. And my apologies for falling off the grid for a couple of days.

    After reading your last line above, I felt very dumb. :/ I don’t know how I missed that! I appreciate your patience and kindness in pointing that out…without being demeaning for my missing that obvious fact. I salute you for that.

    Anyway, back to the problem. I hadn’t done anything with my functions.php since January 19. I opened it and found the culprit…

    	add_action( 'after_setup_theme','tu_after_setup_theme' );
    	function tu_after_setup_theme() {
    	    add_filter( 'generate_show_title', '__return_false' );

    I have no recollection putting that there, but I don’t doubt I did. I commented it out and the problem was resolved.

    So the problem, instead of being a recent development, had been long-standing. And I had no idea. ??

    I’m very sorry to have wasted your time on this. ?? Thank you again for sticking through it with me. I hope that by the middle of the year I can afford to buy GP Premium — I owe you that much, at least. ??

    Grateful but humbled,
    Mark

    Theme Author Tom

    (@edge22)

    No problem at all! I’m glad you were able to find the issue and fix it ??

Viewing 12 replies - 1 through 12 (of 12 total)
  • The topic ‘Missing Titles’ is closed to new replies.