How to add search bar in header for Travelify WordPress theme?

Is there any way how I can add a search form in header for Travelify theme?

I tried get_search_form via header.php but nothing showed up. Am I am missing something?

Search form can be added via Child Theme functions.php file. Sample Child Theme can be downloaded from here.

First you need to add this code to Child Theme functions.php file

// Custom Search in header via Child Theme functions.php
add_action( 'travelify_header', 'my_custom_search' , 5 );

function my_custom_search() {
	get_search_form();
}

When you are done with that you will have to style this form and you can do by adding this Custom CSS to Theme Options - Other - Custom CSS or inside your Child Theme style.css

.searchform {
    height: 30px;
    z-index: 100;
    float: right;
    margin-top: 50px;
    margin-right: 20px;
    margin-left: 10px;
}

#branding input.s {
    border: 1px solid #D0D0D0;
    width: 120px;
    text-indent: 10px;
    padding-left: 10px;
}

Let me know if this helps.

Tnx
It’s work for me!
But Why we should use ChildTheme?

To make your website update safe. Otherwise all your changes done inside code will be lost once you will update theme. This doesn’t apply to customizations done via Theme Options or WordPress customizer but on code changes.

If you don’t edit code, then you don’t need Child Theme but in this case you must have it.

OW MY GOD!

So all of my changes will be lost!!!

What can I do now? I’m on localhost (MAMP) and working on customizing, but on the main theme! how can I transfer them to child theme?

The simplest thing to do is not to update this theme ever again.

Other solutions:

  1. Follow this tutorials.
  2. Move all changes to Child Theme but this will take a lot of time since you will have to compare everything between original and your customized version.

You made your life much, much harder. That’s for sure! :slight_smile:

:frowning: Updates is important :’( :((
Usually which parts of theme will be change on each updates? (From this list below)

    functions.php footer.php exit-style.css rtl.css style.css template-blog-full-content.php content-extensions.php header-extensions.php

It really depends on what changes are made.

The most changes are usually done on style.css but everything can be changed and also when you use automated update then ALL files are replaced and it doesn’t matter if this file is changed or not. WordPress erases the entire folder and replaces it with a new one.

Ok.
I wanna download the theme again and use the one of these sites (http://text-compare.com/ , https://www.diffchecker.com , http://www.textdiff.com/) to compare the texts and find the changes!
But there is just empty Functions.php and Style.css in the Child Theme folder and I don’t know how to make changes from footer.php, rtl.css, template-blog-full-content.php, content-extensions.php, header-extensions.php?

You should compare original theme version with your modified theme version and not Child Theme. Original theme can be downloaded form there.

Yes Yes,
But there is just empty Functions.php and Style.css in the Child Theme folder and I don’t know how to make changes from footer.php, rtl.css, template-blog-full-content.php, content-extensions.php, header-extensions.php?

A great place to start is by looking into this thread.

Default files that are listed here can be just copy/pasted from Parent Theme to Child Theme folder and then modified there.

For files such as content-extensions.php, header-extensions.php you need to follow information on thread I posted above. You need to move function by function because these files won’t be recognized by WordPress when just moved to Child Theme.

So Thank you so much for Fast and great support.

I think it’s so harder than we talking about :slight_smile: :smiley: so I’ll do my changes on parent theme and for updates I’ll download all files and use the Text compare :smiley: From now to the end of the world :smiley: :))

Hi,

Is it possible to setup others headers (perfect for titles and other subjects) on subpages instead of the slider on the home page? I was trying to setup a new post message with a different categorie, but I can’t select a other template…

thanks!

regards Bouke

There is some problem with Search bar in menu on mobile!