I seriously love blogging because I’m being paid for doing what I love doing best. I also do love blogging because i have the option(s) to monetize every part of my blog. How do I mean? You can monetize your images, spaces, videos, blog post and even your search bar. Aint that awesome?
On one of my recent post, I did discuss how to monetize our blog search bar using Google Custom Search Bar. In case you missed the post, you can still click the link to learn more about monetizing your blog search bar.
Monetizing your WordPress mobile search
If you are on mobile right now, it will be nice to scroll to the bottom of my mobile theme and see the search box there. The search box is a customized one from Google, cool right? Who’d you like to know how I did mine so you can do yours as well? If your answer is yes, then follow the little instruction below…
Note: This is a remake of an old post I did when mobilepress theme was still in version 2.x. Now mobilepress have upgraded their theme and some little changes. So this post should help you solve that issue
First of all before you can carry out this operation i am about to show you, you must first read How To Create And Setup A Google Custom Search For Your Blog.
Have you done that? Now the tutorial will be simpler so follow below.
- Open your notepad or if you have dreamweaver or any code edtor, open it because we are about to make us a search box.
- Simply copy the search box you created earlier and paste it in the notepad or dreamweaver. In case you don’t know how the search box code looks like, here it below.
You can copy the above code and change the YOUR-ID-HERE to your pub id.
Have you copied the code? If yes, save it as searchbox.php
Now upload the “searchbox.php to your directory by going to your C-panel >>> Click Legacy File Manager and upload the “searchbox.php” where your WordPress is being installed.
Have you done that? Now let’s start the implementation of the search box to our mobilepress theme. Are you ready?
Hope you are still in your c-panel? Without the quotes, simply click “WP-Content” >>> Plugins >>> Mobilepress >>> Themes >>> defaults
Are you there now? Now click footer.php to either download or use the default c-panel code editor.
If your code editor is opened, search for this tag <?php get_search_form(); ?>
Note: The tag is usually seen at the first line of the footer code. So it shouldn’t be a problem seeing it right?
Have you seen it? Now replace the code with the below one
<center><?php include(‘searchbox.php’); ?></center>
Now click the save button and you are done. The process was simple right? Now go and search your mobile view now and see how accurate your searches will be
Note: Please always backup your blog when messing around with your codes…
Let’s make the post more interesting guys…
Are you using the custom Google search on your blog? to you, which of the search box (default search box and Google custom search box) do you prefer?
Do drop your answers using the comment box below and let’s make the post more fun.
Do you have comments, questions or thoughts you’d love to share with us? Then do use the comment box below. Remember that your comments and thoughts are highly welcome and much appreciated
If you like this post or find it interesting, do click the like button and share us to all your social networks, so your friends can benefit from this awesome post. Do not forget to subscribe to our feed for your latest updates on the go.