Home › Forums › Product Support Forums › Ajax Search Pro for WordPress Support › Two questions about setting › Reply To: Two questions about setting
January 16, 2014 at 4:01 pm
#920
Ok!
You need to add this to the site header.php between the head tags:
<script> $(document).ready(function(){ $(".searchfor").on("click", function(){ var $input = $('.orig', $(this).parent().parent()); $input.val($(this).html()); $('.promagnifier', $(this).parent().parent()).click(); console.log("the input:", $input); }); }); </script>
After that, you need to add the keywords with the following html under the search:
<div class="sfor"> Search for: <a class="searchfor">test</a> <a class="searchfor">post</a> <a class="searchfor">lorem ipsum</a> <a class="searchfor">elements</a> </div>
If you want to style the keywords you can add additional CSS to any css file included in your template:
.sfor { color: #777777; font-size: 12px; padding-left: 5px; } a.searchfor { color: #5990DE; font-size: 12px; }Best,
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)