how to show Author information in search results

It’s called Author Rich Snippets. Your link needs to look like <link href=”https://plus.google.com/115911773396772351667?rel=author”/>Your Name</a> The Simple Way To Set Up Author Rich Snippets There are a few things you need in order to step up Author Rich Snippets: A public Google+ profile. Make sure to upload a decent looking profile picture. Google will use this … Read more

Search posts by Tag

You can hook inside the result, so that you change the query and search about the tags. The result is than a loop with all posts to this tag. You can relized this inside the template, there are is the output for search or write a small plugin, that hook inside the query and change … Read more

Search not working. Appending a “

The form in your HTML code looks like this: <form method=”get” id=”searchform” action=”<?php echo $_SERVER[‘PHP_SELF’]; ?>”> <label class=”hidden” for=”s”><?php _e(‘Search this site:’); ?></label> <input type=”text” value=”Search site” name=”s” id=”s” /> <input type=”submit” id=”searchsubmit” value=”Search” /> </form> PHp is not parsed in this fragment, so I guess you didn’t include a PHP file, just regular HTML. … Read more

Order search results by category

I stumbled over this looking myself for a solution to order posts from WP_Query by their related terms, which seems to be the quintessence of this question. (I’ll answer to the special search case of the question below the general description.) Sorting Posts by related Terms So the key is the MySQL function FIELD() which … Read more

Search Form Based On Tutorial Not Working

Crystal Ball Programming and Why Your Searchbox Failed Your form fails because of this: action=”<?php bloginfo(‘template_url’); ?>/MilkNHny/search.php” You should never directly call a template via URL. Your template assume the WordPress environment has been loaded, which is a fair assumption. However, because you called it directly, it has not. Search.php is the template WordPress looks … Read more

Search – Only search for post meta field

I’m not quite sure this is what you want (because it is so … easy), but all you need to do is add the following inputs to your search form: <input type=”hidden” id=”meta_key” name=”meta_key” value=”YOUR-META-KEY”> <input type=”hidden” id=”meta_value” name=”meta_value” value=”YOUR-META-VALUE”> Or, if you want to trigger the search by hand, do it like so: $search … Read more

Displaying number of search results for each post type

First, your callback to pre_get_posts is wrong. That is not the way that set works. If you had debugging enabled, you’d see Notices. It should be: function more_posts_per_search_page( $query ) { if ( !is_admin() && $query->is_main_query() ) { if ( $query->is_search ) { $query->set(‘posts_per_page’,500); $query->set(‘post_type’,array( ‘author’, ‘book’)); } } } add_action( ‘pre_get_posts’,’more_posts_per_search_page’ ); Second, there … Read more

How to add one more query string with search query string

You should use ‘add_query_arg’ function, to do this. It adds a single key & value or an associative array. You can set a key value to false to remove it from the query. Omitting the old query or the uri (second or third parameter) uses the $_SERVER value. So in your case doing it like … Read more

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