WordPress ¼¼ÇÉ£ºÌá¸ß WordPress ËÑË÷µÄÏà¹ØÐÔ
ʵÔÚ¿¸²»×¡ Google ×Ô¶¨ÒåËÑË÷µÄËÙ¶ÈÁË£¬°Ñ֮ǰµÄËÑË÷»»»ØÁË WordPress ×Ô´øµÄËÑË÷£¬µ«ÊÇ WordPress µÄĬÈÏËÑË÷½á¹ûÊÇ°´ÕÕÎÄÕµķ¢²¼Ê±¼äÀ´ÅÅÐòµÄ£¬ÕâÑùµÄËÑË÷½á¹ûµÄÏà¹ØÐÔ²¢²»Ç¿£¬Ó¦¸ÃÈÃËÑË÷½á¹û°´ÕÕÄÚÈÝÏà¹ØÐÔÅÅÐò£¬¶ø²»ÊÇ°´ÕÕʱ¼ä»òÕß ID£¬ËùÒÔÎÒÃÇ¿ÉÒÔÔÚµ±Ç°Ö÷ÌâµÄ functions.phpÌí¼ÓÈçÏ´úÂëÀ´ÔöÇ¿ WordPress ËÑË÷µÄÏà¹ØÐÔ£º
add_filter£¨‘posts_orderby_request’£¬ ‘wpjam_search_orderby_filter’£©;
function wpjam_search_orderby_filter£¨$orderby = ‘’£©{
global $wpdb;
$keyword = $wpdb->prepare£¨$_REQUEST£Û‘s’£Ý£©;
return “£¨£¨CASE WHEN {$wpdb->posts}.post_title LIKE ‘%{$keyword}%’ THEN 2 ELSE 0 END£© + £¨CASE WHEN {$wpdb->posts}.post_content LIKE ‘%{$keyword}%’ THEN 1 ELSE 0 END£©£© DESC£¬ {$wpdb->posts}.post_modified DESC£¬ {$wpdb->posts}.ID ASC”;
}
ÉÏÃæµÄ´úÂë¾ÍÊÇʹµÃËÑË÷µÄ½á¹¹´úÂ룬ÏÈ°´ÕÕÈÕÖ¾µÄ±êÌâµÄÏà¹ØÐÔÅÅÐò£¬È»ºó°´ÕÕÈÕÖ¾µÄÄÚÈÝ£¬×îºó²ÅÊÇÈÕµÄÖ¾ÐÞ¸Äʱ¼äºÍ ID£¬ÕâÑùµÄÐÞ¸ÄÖ®ºó£¬WordPress ËÑË÷µÄ½á¹ûÏà¹ØÐÔ¾ÍÌá¸ßÁ˺ܶࡣ
ÎÄÕÂÀ´Ô´£ºfairyfish.net
×¢£ºÏà¹ØÍøÕ¾½¨Éè¼¼ÇÉÔĶÁÇëÒƲ½µ½½¨Õ¾½Ì³ÌƵµÀ¡£
ÍƼöÐÅÏ¢
- ¹¹½¨¸ß¿ÉÓú͵¯ÐÔÉìËõµÄKV´æ´¢ÏµÍ³
- ̸̸ÍøÕ¾¾²Ì¬»¯£¨¶þ£©
- ̸̸ÍøÕ¾¾²Ì¬»¯£¨Ò»£©
- Ðì¹úÏ飺΢²©ÊÇ·ñ»á²ÎÓëÍøÕ¾ÅÅÃû
- ApacheÔÚ±¾µØ½¨Á¢·ºÓòÃûÐéÄâÖ÷»ú¼ò·¨
- ÈçºÎ½øÐÐÍøÕ¾Õï¶Ï ΪÍøÕ¾½øÐÐÆÀ·Ö
- Ò»¸ö³É¹¦µÄÕ¾³¤Ó¦¸Ã¾ß±¸µÄËØÖÊ
- Ò»Ìõ΢²©Òý·¢µÄ·ÖÎö£ºÈçºÎÈÃ΢²©µÃµ½¹ã·º´«²¥
- ÈçºÎÈÃÒ»¸öÍøÕ¾ÓÐÇ¿´óÉúÃüÁ¦
- פ×ãIDCÃż÷³Ö±Ò¹ÛÍû Õ¾³¤Ñ¡¹º¿Õ¼ä³É¡°¼èÄѵľö¶¨¡±£¿
ÈÈÃÅÐÅÏ¢
- nohup: redirecting stderr to stdou....
- ʹÓÃlog_formatΪNginx·þÎñÆ÷ÉèÖøüÏêϸµÄÈÕÖ¾¸ñʽ
- jquery easyUI--dataGrid-Json
- [Ô´´]·ÂGoogle Reader¡¢ÐÂÀË΢²©¡¢ÌÚѶ΢²©µ....
- ÀûÓÃKeepalived+mysql¹¹½¨¸ß¿ÉÓÃMySQLË«Ö÷×Ô¶....
- Nginx+keepalivedʵÏÖ¸ºÔؾùºâºÍË«»úÈȱ¸¸ß¿ÉÓÃ
- jqueryʵÏÖÒ³Ãæ¼ÓÔؽø¶ÈÌõ
- Rolling cURL: PHP²¢·¢×î¼Ñʵ¼ù
- codeigniter ·ÓÉÖÕ¼«ÓÅ»¯(url rewrite)
- linuxÏÂÉèÖÃsshÎÞÃÜÂëµÇ¼
ÆÀÂÛ