hightlight search results
This commit is contained in:
parent
c9354c5f2e
commit
e75c9ccfdc
5 changed files with 37 additions and 8 deletions
|
|
@ -1337,6 +1337,10 @@ body.page-theme-color-quaternary form input[type='submit'] {
|
|||
|
||||
.teaser-box-category-marker .icon {
|
||||
mask: url('../img/teaser-box-arrow-brand-secondary.svg') no-repeat center / contain;
|
||||
background-repeat: no-repeat;
|
||||
background-position: left center;
|
||||
background-size: contain;
|
||||
-webkit-mask-image: url('../img/teaser-box-arrow-brand-secondary.svg');
|
||||
position: absolute;
|
||||
right: 0;
|
||||
bottom: 0.55556rem;
|
||||
|
|
@ -1362,6 +1366,10 @@ body.page-theme-color-quaternary form input[type='submit'] {
|
|||
|
||||
.teaser-box-color-brand-secondary .teaser-box-category-marker::after {
|
||||
mask: url('../img/teaser-box-arrow-brand-secondary.svg') no-repeat center / contain;
|
||||
background-repeat: no-repeat;
|
||||
background-position: left center;
|
||||
background-size: contain;
|
||||
-webkit-mask-image: url('../img/teaser-box-arrow-brand-secondary.svg');
|
||||
}
|
||||
|
||||
.teaser-box-color-brand-tertiary .teaser-box-category-marker {
|
||||
|
|
@ -1427,6 +1435,10 @@ body.page-theme-color-secondary .teaser-box-category-marker:hover {
|
|||
|
||||
body.page-theme-color-secondary .teaser-box-category-marker::after {
|
||||
mask: url('../img/teaser-box-arrow-brand-secondary.svg') no-repeat center / contain;
|
||||
background-repeat: no-repeat;
|
||||
background-position: left center;
|
||||
background-size: contain;
|
||||
-webkit-mask-image: url('../img/teaser-box-arrow-brand-secondary.svg');
|
||||
}
|
||||
|
||||
body.page-theme-color-tertiary .teaser-box-image {
|
||||
|
|
|
|||
|
|
@ -38,9 +38,9 @@ ul.bestandliste {
|
|||
padding: 2rem 0 2rem 0;
|
||||
}
|
||||
|
||||
/* @media (max-width: 1024px) {
|
||||
.intro-element .content-wrap #centeredMultiLine {
|
||||
height: 100%;
|
||||
line-height: 4em;
|
||||
display: flex;
|
||||
align-self: flex-end;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
} */
|
||||
|
|
|
|||
|
|
@ -138,3 +138,8 @@ h2.screen-reader-text {
|
|||
.search-term {
|
||||
background-color: yellow;
|
||||
}
|
||||
|
||||
.tx-indexedsearch-redMarkup {
|
||||
font-weight: 400;
|
||||
background-color: rgba(0, 153, 130, 0.1);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -31,11 +31,11 @@
|
|||
<script>
|
||||
document.addEventListener("DOMContentLoaded", function() {
|
||||
console.log("resized");
|
||||
textFit(document.getElementById('centeredMultiLine'), {alignHoriz: true, alignVert: true, multiLine: true, reProcess: true, maxFontSize: 45});
|
||||
textFit(document.getElementById('centeredMultiLine'), {alignHoriz: true, multiLine: true, reProcess: true, maxFontSize: 35});
|
||||
});
|
||||
window.addEventListener('resize', function(event){
|
||||
console.log("resized");
|
||||
textFit(document.getElementById('centeredMultiLine'), {alignHoriz: true, alignVert: true, multiLine: true, reProcess: true, maxFontSize: 45});
|
||||
textFit(document.getElementById('centeredMultiLine'), {alignHoriz: true, multiLine: true, reProcess: true, maxFontSize: 35});
|
||||
});
|
||||
</script>
|
||||
|
||||
|
|
|
|||
|
|
@ -384,3 +384,15 @@ function kit_widgets_init() {
|
|||
|
||||
}
|
||||
add_action( 'widgets_init', 'kit_widgets_init' );
|
||||
|
||||
# Highlight query in search results
|
||||
|
||||
function kit_highlight_results($text){
|
||||
if(is_search()){
|
||||
$sr = get_query_var('s');
|
||||
$keys = explode(" ",$sr);
|
||||
$text = preg_replace('/('.implode('|', $keys) .')/iu', '<strong class="tx-indexedsearch-redMarkup">'.$sr.'</strong>', $text);
|
||||
}
|
||||
return $text;
|
||||
}
|
||||
add_filter('the_excerpt', 'kit_highlight_results');
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue