Arama kısmı kodu (sanırım)
function my_smart_search( $search, &$wp_query ) {
global $wpdb;
if ( empty( $search ))
return $search;
$terms = $wp_query->query_vars[ 's' ];
$exploded = explode( ' ', $terms );
if( $exploded === FALSE || count( $exploded ) == 0 )
$exploded = array( 0 => $terms );
$search = '';
foreach( $exploded as $tag ) {
$search .= " AND (
(wp_posts.post_title LIKE '%$tag%')
AND wp_posts.post_type IN ('tags')
AND (wp_posts.post_status = 'publish')
OR (wp_posts.post_content LIKE '%$tag%')
OR EXISTS
(
SELECT * FROM wp_comments
WHERE comment_post_ID = wp_posts.ID
AND comment_content LIKE '%$tag%'
)
OR EXISTS
(
SELECT * FROM wp_terms
INNER JOIN wp_term_taxonomy
ON wp_term_taxonomy.term_id = wp_terms.term_id
INNER JOIN wp_term_relationships
ON wp_term_relationships.term_taxonomy_id = wp_term_taxonomy.term_taxonomy_id
WHERE taxonomy = 'post_tag'
AND object_id = wp_posts.ID
AND wp_terms.name LIKE '%$tag%'
)
)";
}
return $search;
}
add_filter( 'posts_search', 'my_smart_search', 500, 2 );
$terms = $wp_query->query_vars[ 's' ];
$terms = $wp_query->query_vars[ 'q' ];
$terms = $wp_query->query_vars[ 's' ];
$terms = $wp_query->query_vars[ 'q' ];
>
// Options from admin panel
global $smof_data;
$favicon = $smof_data['custom_favicon'];
if (empty($favicon)) { $favicon = get_template_directory_uri().'/images/web-icon.png'; }
$site_logo = $smof_data['site_logo'];
if (empty($site_logo)) { $site_logo = get_template_directory_uri().'/images/logo.png'; }
?>
>