Info
- 3 posts
- 2 voices
- Started 5 years ago by Fakey
- Latest reply from Fakey
- This topic is not resolved
Small template bug (in search.php of default template)
-
- Posted 5 years ago #
After a search for a word that appears only in the topic title (but not the tags, nor post content) the results are listed, followed by:
No results found.
This is because the
ifstatement is looking for the local variable$topics, instead of the correct variable$titles.It's a small fix, but I didn't know how to post on the bbPress bugtracker.
-
- Posted 5 years ago #
So i think the database field title is not included in the search ?
-
- Posted 5 years ago #
Oh no, quite the contrary. The results are shown fine too. The problem is when the titles are show a local variable
$topicsis created:<?php foreach ( $titles as $topic ) : $count = $topic->topic_posts; ?>This is all fine and dandy, but, as you can see,
$topicis a local variable and won't be any use further down the page when the code checks whether results have been returned or not.I hope I'm making myself clear. Let me reiterate just for kicks: The title results show up fine, but the php code prints "No results found." as well. Just change
$topicsto$titlesin the following code in the template file "search.php":<?php if ( !$topics && !$recent && !$relevant && !$users) : ?> <?php _e('No results found.') ?> <?php endif; ?> -
You must log in to post.