• Resolved DragoWeb

    (@dragoeco)


    Hi,

    I just noticed something strange. The title of some post is not displayed. The .entry-title heading is not even present in the DOM (checked with dev tools).

    So, I’ve checked on the metabox and the box “Disable elements > Content title” was checked. I unchecked it then saved but the checkbox was still checked when I came back. I tried again, and again with some other posts, but same issue. For some reason I’m not able to uncheck this checkbox so I did that manually via phpMyAdmin and set all “_generate-disable-headline” value to false.

    Now all the checkbox are unchecked. Fine. Except… I still not see the title on some posts (crazy). I found a temporary solution by copying the “generate_disable_title” function (inc/general.php => line 211) into my function.php child theme and set “$title = false;”. All the post title are displayed now.

    I don’t know where the problem comes from so maybe you can help me?

    Thanks,

    Pierre

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

    (@leohsiang)

    Hi there,

    Any chance you can link us to the site in question?

    You can use the private information field.

    Let me know ??

    Thread Starter DragoWeb

    (@dragoeco)

    I disabled all plugins and swithed to GP parent theme but still same issue. Then I switching to Twenty Twenty theme and the title is displayed. Must be something on the database I guess… I’ll dig into it and well be back later.

    Yes, I can create an admin access for you but I don’t see the “the private information field”.

    Thanks

    Thread Starter DragoWeb

    (@dragoeco)

    Hi Leo (sorry, I forgot to say “Hi” in my previous message :p),

    I checked the database but everything looks fine to me…

    Leo

    (@leohsiang)

    Sorry there is no private info field in the free forum here.

    Can you link me to the site in question with the parent theme activated?

    Thanks ??

    Thread Starter DragoWeb

    (@dragoeco)

    Hi Leo,

    The first thing I did after installing WP+GP was to disable Guthenberg by adding this line in my child theme function.php :

    add_filter('use_block_editor_for_post', '__return_false');

    I made a test by deleting this line and it worked. When I save the post, it also saves the state of the checkbox now.

    Once I checked each post, I disabled Gutenberg again and despite this everything seems to work normally now. I can check/uncheck each checkbox, WordPress does the save as it should. Wierd…

    I think I’ll keep the override function in the child theme, just in case…

    function generate_disable_title( $title ) {
        if ( is_singular() ) {
            $disable_title = get_post_meta( get_the_ID(), '_generate-disable-headline', true );
            if ( $disable_title ) {
                $title = true;
            }
        }
        return $title;
    }
    add_filter( 'generate_show_title', 'generate_disable_title' );

    *I made a mistake when I wrote my first message: “$title = false;” should have been “$title = true;”

    Leo

    (@leohsiang)

    Glad to hear that you’ve figured out ??

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Post title nos showing on all posts’ is closed to new replies.