Editing the functions.php code messed up my sidebar
-
Hi,
I have caused this very stupid and strange problem to my wordpress site:
I was messing around with the code in functions.php (I shouldn’t do that not being a programmer, I know). What I was trying to do is irrelevant to the problem I’m describing.
Anyway, I pasted a bit of code in functions.php which resulted in the following:
– My dynamic sidebar turned to my default, static sidebar (widgets disappeared)
– Through my WP back-end I do not have access to Widgets any more — it tells me “The theme you are currently using isn’t widget-aware” etc, as if I have never had a dynamic sidebar.
– Removing the code that caused the problem did not result in reverting this change.The code I pasted is this:
function search_excerpt_highlight() { $excerpt = get_the_excerpt(); $keys = implode('|', explode(' ', get_search_query())); $excerpt = preg_replace('/(' . $keys .')/iu', '<strong class="search-highlight"></strong>', $excerpt); echo '<p>' . $excerpt . '</p>'; } function search_title_highlight() { $title = get_the_title(); $keys = implode('|', explode(' ', get_search_query())); $title = preg_replace('/(' . $keys .')/iu', '<strong class="search-highlight"></strong>', $title); echo $title; }
Any ideas?
- The topic ‘Editing the functions.php code messed up my sidebar’ is closed to new replies.