Title: Manuel Sailer's Replies | WordPress.org

---

# Manuel Sailer

  [  ](https://wordpress.org/support/users/msailer/)

 *   [Profile](https://wordpress.org/support/users/msailer/)
 *   [Topics Started](https://wordpress.org/support/users/msailer/topics/)
 *   [Replies Created](https://wordpress.org/support/users/msailer/replies/)
 *   [Reviews Written](https://wordpress.org/support/users/msailer/reviews/)
 *   [Topics Replied To](https://wordpress.org/support/users/msailer/replied-to/)
 *   [Engagements](https://wordpress.org/support/users/msailer/engagements/)
 *   [Favorites](https://wordpress.org/support/users/msailer/favorites/)

 Search replies:

## Forum Replies Created

Viewing 14 replies - 1 through 14 (of 14 total)

 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Secondary Title] Auto show secondary titles not working with some titles](https://wordpress.org/support/topic/auto-show-secondary-titles-not-working-with-some-titles/)
 *  Thread Starter [Manuel Sailer](https://wordpress.org/support/users/msailer/)
 * (@msailer)
 * [5 years, 4 months ago](https://wordpress.org/support/topic/auto-show-secondary-titles-not-working-with-some-titles/page/2/#post-14286325)
 * Oh no, I am sorry to read this.
 * I think the new problem has something to do with the `only_show_in_main_post`
   option that I do not use. But I did some testing now and found out that it does
   not work _as expected_ – at least with yesterday’s changes.
 * To make `only_show_in_main_post` work and display the secondary title only when
   the post is displayed as single page I changed the code to:
 *     ```
       /** Validate secondary title */
       if ( ! $secondary_title || 
            get_option( "secondary_title_auto_show" ) === "off" || 
            is_admin() || 
            empty( $secondary_title ) || 
            ( get_option( "secondary_title_only_show_in_main_post" ) === "on" &&
              !is_single() ) ) {
         return $standard_title;
       }
   
       $secondary_title = wptexturize( $secondary_title );
       ```
   
 * It seems the later `Only display if title is within the main loop` part that 
   also uses the `only_show_in_main_post` option and which I expected to provide
   this functionality does not do anything.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Secondary Title] Auto show secondary titles not working with some titles](https://wordpress.org/support/topic/auto-show-secondary-titles-not-working-with-some-titles/)
 *  Thread Starter [Manuel Sailer](https://wordpress.org/support/users/msailer/)
 * (@msailer)
 * [5 years, 4 months ago](https://wordpress.org/support/topic/auto-show-secondary-titles-not-working-with-some-titles/page/2/#post-14285025)
 * [@thaikolja](https://wordpress.org/support/users/thaikolja/) I’ve had a look 
   at the code, downloaded the dev version once again, installed and tested it. 
   And all test cases work as expected. So my thumbs up for pushing the changes 
   to the next version.
 * Thank you very much!
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Secondary Title] Auto show secondary titles not working with some titles](https://wordpress.org/support/topic/auto-show-secondary-titles-not-working-with-some-titles/)
 *  Thread Starter [Manuel Sailer](https://wordpress.org/support/users/msailer/)
 * (@msailer)
 * [5 years, 4 months ago](https://wordpress.org/support/topic/auto-show-secondary-titles-not-working-with-some-titles/#post-14284961)
 * You are absolutely right! 🙂
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Secondary Title] Auto show secondary titles not working with some titles](https://wordpress.org/support/topic/auto-show-secondary-titles-not-working-with-some-titles/)
 *  Thread Starter [Manuel Sailer](https://wordpress.org/support/users/msailer/)
 * (@msailer)
 * [5 years, 4 months ago](https://wordpress.org/support/topic/auto-show-secondary-titles-not-working-with-some-titles/#post-14284925)
 * The reduction I suggested does not change important code and validations.
    It
   leaves the conditions as you already changed them but removes code that you added
   as special handling for wp-Typography. This code is not required as there is 
   no condition anymore that compares the outputs of _htmlspecialchars\_decode_ 
   and _wptexturize_.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Secondary Title] Auto show secondary titles not working with some titles](https://wordpress.org/support/topic/auto-show-secondary-titles-not-working-with-some-titles/)
 *  Thread Starter [Manuel Sailer](https://wordpress.org/support/users/msailer/)
 * (@msailer)
 * [5 years, 4 months ago](https://wordpress.org/support/topic/auto-show-secondary-titles-not-working-with-some-titles/#post-14284824)
 * Hi again [@thaikolja](https://wordpress.org/support/users/thaikolja/) ,
 * my test cases also work if I reduce the validation to
 *     ```
       /** Validate secondary title */
       if ( ! $secondary_title || get_option( "secondary_title_auto_show" ) === "off" || is_admin() ) {
         if ( empty($secondary_title) ) {
           return $standard_title;
         }
   
         $secondary_title = wptexturize( $secondary_title );
       }
       ```
   
 * The important thing was that you removed this comparison: $title !== wptexturize(
   $post->post_title )`. If there is no such condition there is no need for special
   handling when wp-Typography is active.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Secondary Title] Auto show secondary titles not working with some titles](https://wordpress.org/support/topic/auto-show-secondary-titles-not-working-with-some-titles/)
 *  Thread Starter [Manuel Sailer](https://wordpress.org/support/users/msailer/)
 * (@msailer)
 * [5 years, 4 months ago](https://wordpress.org/support/topic/auto-show-secondary-titles-not-working-with-some-titles/#post-14284693)
 * Hi [@thaikolja](https://wordpress.org/support/users/thaikolja/) ,
 * I tested the dev version you provided and had to make some little changes to 
   make it work. This code is working for me:
 *     ```
       /** Validate secondary title */
       if ( ! $secondary_title || get_option( "secondary_title_auto_show" ) === "off" || is_admin() ) {
         if ( empty($secondary_title) ) {
           return $standard_title;
         }
   
         $secondary_title = wptexturize( $secondary_title );
   
         if ( class_exists( "WP_Typography" ) ) {
           $secondary_title = htmlspecialchars_decode( $secondary_title );
         }
       }
       ```
   
 * The check for empty secondary title is necessary as non filled secondary titles
   on posts are stored as empty _\_secondary\_title_ entries in the _postmeta_ database
   table.
    In the dev version `secondary_title_auto_show` generates HTML markup 
   for these also. So `content` added by CSS `:before` and `:after` the empty secondary
   title gets rendered. Returning `$standard_title` in this case (as in the previous
   official version) solves the problem.
 * And of course secondary titles work on posts with _&_ in the title and wp-Typography
   enabled. Thank you very much! 🙂
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Secondary Title] Auto show secondary titles not working with some titles](https://wordpress.org/support/topic/auto-show-secondary-titles-not-working-with-some-titles/)
 *  Thread Starter [Manuel Sailer](https://wordpress.org/support/users/msailer/)
 * (@msailer)
 * [5 years, 4 months ago](https://wordpress.org/support/topic/auto-show-secondary-titles-not-working-with-some-titles/#post-14284422)
 * Hi [@thaikolja](https://wordpress.org/support/users/thaikolja/) ,
 * thank you very much for your quick reply.
    But don’t be so hard on yourself. 
   The dumbness might be on the other side. 😉
 * To give you a working step-by-step guide I did some more investigation and found
   out that the problem only occurs when the output is processed by the [wp-Typography](https://de.wordpress.org/plugins/wp-typography/)
   plugin.
    Without having wp-Typography installed the problem does not occur but
   can be easily switched on/off by enabling/disabling this plugin.
 * So this is the step-by-step guide to reproduce the error:
    1. Install wp-Typography plugin and enable it.
    2. Create a new post with an & in the title (e. g. _Main & Title_) and any Secondary
       Title and publish it.
    3. Watch the post in your browser.
        Secondary Title should not be visible.
    4. Disable wp-Typography plugin and reload the post in the browser.
        Secondary 
       Title should be visible.
 * Of course I would be happy if Secondary Title and wp-Typography could be used
   together. But if you tell me that I have to solve this compatibility problem 
   myself, I will accept that and apologize for blaming your plugin and stealing
   your time.
 * Have a nice evening.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Media Library Assistant] Again: Maintain scroll position on pagination](https://wordpress.org/support/topic/again-maintain-scroll-position-on-pagination/)
 *  Thread Starter [Manuel Sailer](https://wordpress.org/support/users/msailer/)
 * (@msailer)
 * [5 years, 4 months ago](https://wordpress.org/support/topic/again-maintain-scroll-position-on-pagination/#post-14187855)
 * Installed MLA 2.95 and verified that anchors in `mla_link_href` work as expected.
   
   Thanks again!
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[wp-Typography] Disable hyphenation for tag or class](https://wordpress.org/support/topic/disable-hyphenation-for-tag-or-class/)
 *  Thread Starter [Manuel Sailer](https://wordpress.org/support/users/msailer/)
 * (@msailer)
 * [5 years, 5 months ago](https://wordpress.org/support/topic/disable-hyphenation-for-tag-or-class/#post-14142769)
 * Hi [@pputzer](https://wordpress.org/support/users/pputzer/),
 * thank you for your quick reply and your suggestion how to work around this problem.
 * As you found out yourself, [@msaari](https://wordpress.org/support/users/msaari/)
   was also very fast in providing a new version of the Relevanssi plugin that fixes
   the problem by ignoring the soft hyphens injected by wp-Typography. I think you’ll
   agree that taking this solution is the better choice as highlighting and hyphenation
   will both be there in the result.
 * In the topic [Highlighting works only in some search results](https://wordpress.org/support/topic/highlighting-works-only-in-some-search-results/#post-14142454)
   you gave some interesting insights into wp-Typography and the problems that might
   occur regarding content filter hooks and priority or when doing everything later
   on the whole document – what would be my favorite solution.
    Maybe toying a little
   more with that idea and ongoing improvements in standard conformity of libraries
   and browsers may give the chance to implement it that way some time in future.
   🙂
 * So big thanks again from me to both of you!
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Relevanssi - A Better Search] Highlighting works only in some search results](https://wordpress.org/support/topic/highlighting-works-only-in-some-search-results/)
 *  Thread Starter [Manuel Sailer](https://wordpress.org/support/users/msailer/)
 * (@msailer)
 * [5 years, 5 months ago](https://wordpress.org/support/topic/highlighting-works-only-in-some-search-results/#post-14142430)
 * [@msaari](https://wordpress.org/support/users/msaari/)
    Great thing! Highlighting
   is working now – even with hyphenation enabled in wp-Typography. Thanks for the
   quick fix and new release of Relevanssi.
 * [@pputzer](https://wordpress.org/support/users/pputzer/)
    In Relevanssi highlighting
   is done in PHP. I absolutely agree Mikko that wp-Typography’s hyphenation should
   be done after Relevanssi’s highlighting. From my point of view it would be best
   if hyphenation could be the last step before the generated HTML will be send 
   to the browser. This would reduce impact not just on Relevanssi but any plugin
   that needs the content in its original state and would behave similar as if hyphenation
   would be done on the browser side using CSS. But as you wrote in our [Disable hyphenation for tag or class](https://wordpress.org/support/topic/disable-hyphenation-for-tag-or-class/)
   topic hyphenation is done even before the content is filled into to the template.
   So maybe “priority juggling” might help.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Relevanssi - A Better Search] Highlighting works only in some search results](https://wordpress.org/support/topic/highlighting-works-only-in-some-search-results/)
 *  Thread Starter [Manuel Sailer](https://wordpress.org/support/users/msailer/)
 * (@msailer)
 * [5 years, 5 months ago](https://wordpress.org/support/topic/highlighting-works-only-in-some-search-results/#post-14138624)
 * Hi Mikko,
 * thank you very much for investigating this for me!
 * What you write sounds absolutely logical. I just wonder, why I cannot see these
   soft hyphens even in source code view in Firefox, Chromium and Vivaldi.
    But 
   I found the reason for them, it’s the wp-Typography plugin I mainly use to auto
   correct English quotation marks (“…”) and dashes (-) entered when typing to the
   correct alternatives in German „…“ and —, but there is also auto-hyphenation 
   that leads to all these soft hyphens. Will see whether I’ll test CSS hyphenation
   instead.
 * I tried to apply the changes you suggested in excerpt-highlights.php but could
   not find the line to change – event with _&shy;_ as the first parameter that 
   is only visible (to me) when inspecting the source code of your answer above.
   The only _&shy;_ I found in the Relevanssi code is in common.php where a $replacement_array
   is defined.
    But while searching for anything regarding hyphens I found your 
   note in the changelog of version 2.4 telling that soft hyphens “still confuse
   the highlighting” and no later note telling that this was solved. 🙂
 * So for the moment I will disable highlighting in search results and wait for 
   the next version of Relevansssi. Of course I will try highlighting again and 
   tell you when I still experience problems with that functionality.
 * Thanks again and I hope solving this problem could help improving Relevanssi 
   a little.
 * Edit:
    Disabled hyphenation in wp-Typography and highlighting in search results
   works for all posts and pages without changing or saving them again. That means
   hyphenation takes place when the HTML output is generated, not while saving the
   post. Might it be possible to reorder the processing steps and execute Relevanssi’s
   highlighting before wp-Typography’s hyphenation?
    -  This reply was modified 5 years, 5 months ago by [Manuel Sailer](https://wordpress.org/support/users/msailer/).
      Reason: Further testing after disabling hyphenation in wp-Typography
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Relevanssi - A Better Search] Highlighting works only in some search results](https://wordpress.org/support/topic/highlighting-works-only-in-some-search-results/)
 *  Thread Starter [Manuel Sailer](https://wordpress.org/support/users/msailer/)
 * (@msailer)
 * [5 years, 5 months ago](https://wordpress.org/support/topic/highlighting-works-only-in-some-search-results/#post-14134538)
 * The word “Stiftskeller” in the “Waiblinger Kreiszeitung” search result is not
   part of this posts content. It is in the excerpt of the “April – Mai 2016” post(
   first search result) which is a related article.
 * This is what is in the post_excerpt field of that post’s database entry:
    `Bereits
   zum zweiten Mal hat der KUNSTRAUM WEINSTADT die Möglichkeit, Werke seiner Künsterinnen
   und Künstler im historischen Stiftskeller in Weinstadt-Beutelsbach auszustellen.
   Das Motto dieses Mal: „Farbe leben“. Und bunt wird sie sein, diese Ausstellung,
   nicht nur an Farben, sondern auch an dadurch transportierten Emotionen und Stimmungen.
   Werke in Aquarell, Acryl, Öl und Mischtechnik hängen an rohen Mauern oder Stellwänden,
   Encaustic, auch in Verbindung mit Schellack, und Fotodruck sind ausgestellt.`
 * And this is the source code of the Relevanssi excerpt:
    `<p><span class="excerpt_part"
   >© ZVW – Waib­lin­ger Kreis­zei­tung Aus­stel­lung Mehr Infor­ma­tio­nen zu und
   Impres­sio­nen von der im Pres­se­be­richt beschrie­be­nen Aus­stel­lung fin­den
   Sie&nbsp;hier:&nbsp; März – April 2016: „Far­be leben“ im Stifts­kel­ler Beu­tels­bach
   Bereits zum zwei­ten Mal hat der KUNSTRAUM WEINSTADT die Mög­lich­keit, Wer­ke
   sei­ner Küns­ter­in­nen und Künst­ler im his­to­ri­schen Stifts­kel­ler in Wein­­­stadt-
   Beu­­­tel­s­­­bach aus­zu­stel­len. Das Mot­to die­ses Mal: „Far­be leben“. Und
   bunt wird&nbsp;sie…</span></p>`
 * There is absolutely nothing special in the database or the Relevanssi excerpt
   that might break a
    `$content = str_replace('Stiftskeller', '<span style="color:#
   ff0000">Stiftskeller</span>', $content);` or whatever you might be doing to highlight
   keywords.
 * For a short moment I thought it might be a problem whether the keyword is in 
   the title or the excerpt of a related article. But this is not true.
 * I proved that with another example [here](https://ibb.co/X3k0cr5). The search
   phrase in this example is _erleben_ and only the last occurrence is highlighted
   correctly. The first occurrence (first row of the Relevanssi excerpt) is in the
   title of a related article and the second occurrence (last row of the Relevanssi
   excerpt) is in the excerpt of the related article – exactly as the correctly 
   highlighted keyword at the end of the Relevanssi excerpt.
 * This is the source code of the Relevanssi excerpt:
    `<p><span class="excerpt_part"
   >…zu und Impres­sio­nen von der im Pres­se­be­richt beschrie­be­nen Aus­stel­lung
   fin­den Sie&nbsp;hier:&nbsp; Febru­ar – März 2019: „Grün erle­ben“ im Rat­haus
   Beu­tels­bach Die­se Aus­stel­lung ist unse­re Auf­takt­ver­an­stal­tung im Jahr
   der Rem­s­­­tal-Gar­­­ten­­­schau und unse­re drit­te Aus­stel­lung im Rat­haus
   in Wein­­­stadt-Beu­­­tel­s­­­bach. Die herr­lich grü­ne Land­schaft des Rems­tals
   und das Gar­­­ten­­­schau-Mot­­­to „unend­lich erle­ben” neh­men wir auf und 
   ver­bin­den die­se zum The­ma unse­rer Aus­stel­lung „Grün <span style="color:#
   ff0000">erle­ben</span>”.…</span></p>`
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Relevanssi - A Better Search] Highlighting works only in some search results](https://wordpress.org/support/topic/highlighting-works-only-in-some-search-results/)
 *  Thread Starter [Manuel Sailer](https://wordpress.org/support/users/msailer/)
 * (@msailer)
 * [5 years, 5 months ago](https://wordpress.org/support/topic/highlighting-works-only-in-some-search-results/#post-14132510)
 * Hi Mikko,
 * thank you for your quick reply. Sorry that I did not provide enough information
   but I did not expect that the context could be relevant for highlighting a keyword.
 * I prepared some more screenshots without pixelization now. I did separate searches
   for keywords in the surrounding context of _Stiftskeller_ and focussed on two
   search results by removing all other ones.
 * You can find the screenshots [here](https://ibb.co/934GLrf) (keyword _Stiftskeller_),
   [here](https://ibb.co/1vTqHtj) (keyword _historischen_) and [here](https://ibb.co/hVH2LHB)(
   keyword _Beutelsbach_).
 * I also tried enabling “Expand highlights to cover full words” but it makes no
   difference. Highlighting stays exactly the same as in the screenshots provided.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Media Library Assistant] Again: Maintain scroll position on pagination](https://wordpress.org/support/topic/again-maintain-scroll-position-on-pagination/)
 *  Thread Starter [Manuel Sailer](https://wordpress.org/support/users/msailer/)
 * (@msailer)
 * [5 years, 5 months ago](https://wordpress.org/support/topic/again-maintain-scroll-position-on-pagination/#post-14099461)
 * Installed it as described and works like a charm. 🙂
    Thank you very much!
 * I think we should wait to set the topic status to “resolved” until your fix is
   released in the next none development version of MLA.

Viewing 14 replies - 1 through 14 (of 14 total)