WPIntell

Source evidence

Hide Title no longer working sometime after 5.0 update

Hide Title · support · 2018-12-20T16:49:00+00:00

complaintsentiment
mediumseverity
0.93relevance
11replies
Evidence linked to opportunitycommercial context

Proof Health

Open evidence

Commercial opportunities need traceable source links before they are treated as build-worthy.

5 / 34 rows with source links

14.7% of this page's analysis has direct source links.

0 build-decision rows missing links

0 rows here require auditable proof before promotion.

29 rows with no attached evidence

0 rows have source counts but still need direct links.

Conversation

support
3cstudio unresolved
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] 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. Same for another site: https://skinnysonline.com/ . . . ?? 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 7 years, 5 months ago by nycmw . This reply was modified 7 years, 5 months ago by nycmw . 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! 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? @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 7 years, 4 months 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. @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?

Comments

11 shown
3cstudio 2018-12-20T16:51:00+00:00

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 2018-12-20T17:01:00+00:00

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

nycmw 2018-12-20T17:10:00+00:00

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 7 years, 5 months ago by nycmw . This reply was modified 7 years, 5 months ago by nycmw .

3cstudio 2018-12-20T17:23:00+00:00

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 2019-01-19T00:03:00+00:00

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.

Anonymous User 2019-01-25T16:39:00+00:00

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 2019-01-25T21:37:00+00:00

@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 7 years, 4 months ago by kbonner .

Anonymous User 2019-01-25T21:59:00+00:00

@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.

Anonymous User 2019-01-27T16:25:00+00:00

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 2019-01-28T22:06:00+00:00

@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.

Anonymous User 2019-02-04T18:18:00+00:00

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