Created
July 20, 2022 14:58
-
-
Save divienginesupport/bcb7e6b2607dc3795f87baa1fc9dad80 to your computer and use it in GitHub Desktop.
Divi Machine - Search posts - Results page with custom title
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script> | |
jQuery( document ).ready(function() { | |
let search_title=jQuery("#search-title"); | |
let search_term=jQuery("#search-term"); | |
search_term = search_term.text().match(/"(.*?)"/)[1]; | |
let search_title_text = search_title.text(); | |
console.log(search_title_text); | |
console.log(search_term); | |
search_title.text(`${search_title_text}: "${search_term}" `); | |
jQuery("#search-term").remove(); | |
}); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment