English Personal ramblings about Graphic, Webdesign, Inspiration. Adobe & WP
Czech Písání o Grafice, Webdesignu, Inspirace. Adobe & WP

Zdvojené výsledky hledání – oprava

Zdvojené výsledky hledání článků zařazených do více kategorií

Po upgrade na 2.2.2. dochází v kombinaci s pluginem Events Calendar k chybnému vypsání vyhledaných příspěvků pro každou kategorii znovu a znovu, př. článek máme v šesti kategoriích, ve výsledcích hledání je tedy také šestkrát. Řešení je naštěstí jednoduché, viz. níže uvedený zdroj.

WordPress › Support » Search results duplicated if in more than one category (2.1)

Question: With WP 2.1 a search will now repeat a post found through a search as many times as it has categories.

So, for example, if I have a post tagged under 'technology', 'science' and 'sport', any search where that is a result will display the post three times. This didn't happen with previous versions. Any idea about a hack to only ever display a search result once? Thanks.

Answer: I've no problem with Event Calendar working with 2.1 and made the following change in eventcalendar3.php to get rid of the problem in function 'ec3_filter_posts_where' add the following to the first if statement:

PHP:
  1. || $wp_query->is_search

Share and Enjoy:

  • Digg
  • del.icio.us
  • Facebook
  • FriendFeed
  • Google Bookmarks
  • Live
  • LinkedIn
  • Mixx
  • MySpace
  • Netvouz
  • Ping.fm
  • SphereIt
  • StumbleUpon
  • Technorati
  • Twitter
10. 9. 2007 8.00
This entry was posted on Monday, September 10th, 2007 at 8.00 and is filed under Tips, Wordpress. You can follow any responses to this entry through the RSS 2.0 feed. Both comments and pings are currently closed.
If you like this post, you can grab our RSS or you can subscribe by Email.
Similar Posts:

Comments are closed.


Top Phire Base (C) 2002-2010 | WPWebHost | Sitemap
WordPress 41 queries. 1.553 seconds.