Search results adding to the title
- gkandylakisParticipant4 years, 2 months ago #20860
how can i turn off the <b> on the search results? My template uses Bold on all its headers and we get <b>PRODUCT NAME</b> in all results
gkandylakisParticipant4 years, 2 months ago #20864I tried it and didn’t work. When i tried to copy the structure of the HTML here i noticed that the browser is reading it as <b> and not <b>. When i manually edited the html the problem disappeared.
gkandylakisParticipant4 years, 2 months ago #20865the browser translates it so it got lost so i’m putting spaces between them
& lt ; b & gt; and not <b>
The html entities don’t work properly inside an hrefgkandylakisParticipant4 years, 2 months ago #20869no it is not. I can see in the default highlights you are using the following
<str name=”hl.simple.pre”>& lt;b& gt;</str>
<str name=”hl.simple.post”>& lt;/b& gt;</str>Should i replace the HTML entities?
gkandylakisParticipant4 years, 2 months ago #20873wpsolr-pro/wpsolr/core/classes/engines/solarium/admin/conf/4.0/solrconfig.xml:995
wpsolr-pro/wpsolr/core/classes/engines/solarium/admin/conf/4.0/old/wpsolr-v4/solrconfig.xml:993
wpsolr-pro/wpsolr/core/classes/engines/solarium/admin/conf/opensolr/4.0/solrconfig.xml:995
wpsolr-pro/wpsolr/core/classes/engines/redisearch_php/admin/conf/4.0/solrconfig.xml:995
wpsolr-pro/wpsolr/core/classes/engines/redisearch_php/admin/conf/4.0/old/wpsolr-v4/solrconfig.xml:993
wpsolr-pro/wpsolr/core/classes/engines/redisearch_php/admin/conf/opensolr/4.0/solrconfig.xml:995wpsolrKeymaster4 years, 2 months ago #20875Thanks, but the config file is overridden by the code.
There is a filter to do that: WPSOLR_Events::WPSOLR_FILTER_HIGHLIGHTING_PREFIX
An exemple in /wp-content/plugins/wpsolr-pro/wpsolr/core/classes/extensions/premium/class-wpsolr-option-premium.php:
// No highlighting tags add_filter( WPSOLR_Events::WPSOLR_FILTER_HIGHLIGHTING_PREFIX, [ $this, 'wpsolr_filter_highlighting_prefix' ], 10, 1 ); add_filter( WPSOLR_Events::WPSOLR_FILTER_HIGHLIGHTING_POSFIX, [ $this, 'wpsolr_filter_highlighting_posfix' ], 10, 1 ); /** * * Update highlightings prefix * * @return string */ public function wpsolr_filter_highlighting_prefix( $prefix_tag ) { return $this->_wpsolr_filter_highlighting_tag( $prefix_tag ); } /** * * Update highlightings postfix * * @return string */ public function wpsolr_filter_highlighting_posfix( $postfix_tag ) { return $this->_wpsolr_filter_highlighting_tag( $postfix_tag ); } /** * * Update highlightings tag * * @return string */ protected function _wpsolr_filter_highlighting_tag( $tag ) { if ( $this->is_replace_admin_post_type_by_wpsolr_query || $this->is_replace_admin_admin_taxonomy_by_wpsolr_query ) { return ''; } return $tag; }
gkandylakisParticipant4 years, 2 months ago #20881So what do i need to change to make it work?
gkandylakisParticipant4 years, 2 months ago #20885sorry but i don’t understand what you are saying. Can you explain?
gkandylakisParticipant4 years, 2 months ago #20895i tried. It’s not overriding the plugin functions
gkandylakisParticipant4 years, 2 months ago #21230I’m getting
Fatal error: Uncaught Error: Class ‘WPSOLR_Events’ not found
when i put your code in our function.php
You must be logged in to reply to this topic.