Search results: How to add direct jump to anchor?

You should have the navigation menu with anchors on your page. <ol> <li><a href=”#products”>Products</a></li> <li><a href=”#examples”>Example</a></li> </ol> And the sections with relevant ID where are these anchors are linked to. <h2 id=”products”>Products</h2> After the changes are done, ask google to reindex your page and wait=) Here is detailed description: here

Listing parent section in search results

For your custom post types and your blog, you can use get_post_type(). For your About parent page, if the pages only go one level deep, you can check $post->post_parent to see if it’s the about page. Otherwise, you can use get_post_ancestors() and check that array to see if your About page is in it!

Strip the + symbol from the_search_query

Personally, when I do things like this I use str_replace() [Link] Using your above example it would be implemented like so: <?php $string = the_search_query(); $res = str_replace(“+”, ” “, $string); echo $res; ?> That will replace any + with a space. Or if you want the &nbsp; use this: <?php $string = the_search_query(); $res … Read more

SQL: Search query to get attachments only of those parents which are published

Well since nobody helped with at first look such an easy problem, i used my way, and if somebody will need it here it is: I used this query: $results = $wpdb->get_results( $wpdb->prepare( “select $wpdb->posts.ID, $wpdb->posts.post_status, $wpdb->posts.post_parent from $wpdb->posts where post_title like ‘%%%s%%’ and (post_type=”albumas” OR post_mime_type=”audio/mpeg”) AND (post_status=”inherit” OR post_status=”publish”) $excludes limit 0,”.$setting->limit, ($setting->search_content … Read more

Relevanssi show only 1 result

Try selecting “always” for fuzzy matches in the preferences. In the default setting, if search finds only 1 result, fuzzy matching won’t get activated.

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)