Support » Plugin: Hide Title » Hide Title no longer working sometime after 5.0 update

  • 3cstudio

    (@3cstudio)


    I recently had the page in question NOT showing the title, but now it shows sometime after I updated to WP 5.0 and installed/activated the Classic Editor Plugin. Please advise. Thanks in advance!

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

Viewing 11 replies - 1 through 11 (of 11 total)
  • 3cstudio

    (@3cstudio)

    addendum: I did follow the suggested “add <?php wp_head(); ?> to header.php just before the </head> tag” as it never left the theme’s header.php file anyway.

    3cstudio

    (@3cstudio)

    Same for another site: https://skinnysonline.com/ . . . ??

    nycmw

    (@nycmw)

    Yup having the same issue on several of our websites too.

    [Works fine in 4.9.9 but fails to work in 5+]

    • This reply was modified 4 months ago by  nycmw.
    • This reply was modified 4 months ago by  nycmw.
    3cstudio

    (@3cstudio)

    nycmw,
    I just switched to Title Remover: https://wordpress.org/plugins/title-remover/ and it works great. Since this Support forum looks unattended (not many dev responses), & Title Remover works, I went with it.
    Sad that Hide Title doesn’t work anymore — I use it on many sites — looks like I’m going to have to switch all of them to Title Remover!

    kbonner

    (@kristinebonner)

    It broke for me too. I reverted to the previous version (1.04) and all is fine. The only difference in the new version and the previous one is that the author implemented the code suggested here: https://wordpress.org/support/topic/suggested-fix-for-the-code/
    and it apparently broke it for many users. I’m going to keep with the previous version and hope the author comes out with another update to fix it soon. I have a lot of pages I’d have to go through and fix if I switched to another plugin.

    I think you’re on the right track, @kristinebonner.

    That suggested fix looks like it was implemented without testing, as I believe that strcmp() actually returns 0, which stops that conditional from ever occurring.

    I believe a super simple fix would be to change that conditional to actually check to the see if the strcmp returns 0 as it should if the two strings are identical: http://php.net/manual/en/function.strcmp.php

    So:

    public function wrap_title( $content ){
    	if( $this->is_hidden() && strcmp($content, $this->title) && $this->afterHead ){
    		$content = '<span class="' . $this->slug . '">' . $content . '</span>';
    	}
    	return $content;
    } // wrap_title()

    becomes:

    public function wrap_title( $content ){
    	if( $this->is_hidden() && (strcmp($content, $this->title)==0) && $this->afterHead ){
    		$content = '<span class="' . $this->slug . '">' . $content . '</span>';
    	}
    	return $content;
    } // wrap_title()

    Can anyone else test this on a site encountering the issue to see if this resolves your issue?

    kbonner

    (@kristinebonner)

    @ericsembrat thanks for looking into this! I took a leap and tried it on a live site, but it didn’t work so I reverted again. There was no error in my log though. I’ll try it again on a dev site when I get chance and report back.

    • This reply was modified 2 months, 4 weeks ago by  kbonner.

    @kristinebonner Thanks for the check. Please let me know how it looks on your dev site and we can try to see if our issues and solutions compare.

    We deployed this on our dev and live multi-user installs, and this resolved the issue for us. Sites and pages with the setting for Hide Title are now having the dojodigital_toggle_title span class applied to it.

    kbonner

    (@kristinebonner)

    @ericsembrat I confirm your fix is now working for me. However I get a brief flash of the page title before it disappears when the page loads. I’m going to check out the Title Remover plugin.

    @dojodigital can we please get this pushed to a new release?

Viewing 11 replies - 1 through 11 (of 11 total)
  • You must be logged in to reply to this topic.