Tagged: x
-
AuthorPosts
-
August 22, 2016 at 9:01 am #1141486
Hi! I would like to include a search bar to my blog page, something like the attached picture. I’ve looked around and I guess, I have to modify the template so I installed a child theme. I am using Ethos stack.
Could you help me, please?My website is: http://magicsolutions.eu/mgs_web/blog/
Thanks in advance!
August 22, 2016 at 10:25 am #1141586Hey There,
Thanks for writing in!
You can add full width search bar with a media queries to fit it with all devices.
.searchandfilter input[type="text"] {font-size:26px; width:630px;} @media only screen and (max-width: 767px) and (min-width: 480px){ .searchandfilter input[type="text"] {width:325px;} } @media only screen and (max-width: 479px){ .searchandfilter input[type="text"] {font-size:16px; width:180px;} }
Hope this helps!
August 22, 2016 at 10:36 am #1141596Thank you for answering so fast.
Well, the problem is that the searchbar is not existing yet. The image I’ve attached above is just an illustration. Right now the blog looks like this. So i have to insert the sidebar somehow. Or do I have just to copy that code you wrote somewhere? (I tried to copy under CustomCSS but nothing happened.)So my question. How can I insert a searchbar to blog section when there is no searchbar at all?
August 22, 2016 at 2:57 pm #1142018HI there,
Would you mind specifying which part of the blog page you want the search bar to be placed? If you can, kindly provide us with a mockup design of what you are trying to achieve so that we’ll have a better idea of what you’re aiming to do.
Thank you.
August 23, 2016 at 3:52 am #1142767Okay.
So here is my blog posts page (where my posts are): http://magicsolutions.eu/mgs_web/blog/
Right now looks like in this picture (https://s3.amazonaws.com/community-themeco/app/uploads/2016/08/22103657/now.png).
I would like to place a search bar below the nav-bar and above the posts, like in this picture (https://s3.amazonaws.com/community-themeco/app/uploads/2016/08/22090152/legyen.png).
Basically the functionality would be the same like the single post view’s sidebar search field.
How is it possible?August 23, 2016 at 8:02 am #1143001Hi,
You can add this in your child theme’s functions.php file (wp-content/themes/x-child/functions.php)
function add_search(){ if(is_home()){ echo '<div class="my-search">'.get_search_form().'</div>'; } } add_action('x_after_view_global__slider-below', 'add_search');
Kindly add it after this line
// Additional Functions
// =============================================================================Hope that helps
August 31, 2016 at 4:49 am #1154816Yes, this works well! Thank you very much!
August 31, 2016 at 5:55 am #1154891Glad it worked 🙂
If you need anything else please let us know.
December 12, 2016 at 6:52 pm #1290716Hi, I am trying to do something similar.
I want the search field to be smaller and I want it to be to the left of the page title.
Thank you.
December 12, 2016 at 11:40 pm #1290838Hello @kev_lem,
Thanks for writing in!
Would you mind providing us with your website URL in a separate ticket so we can take a closer look?
Thanks.
-
AuthorPosts