<div class="bs-sidebar hidden-print" role="complementary">
    <div class="row">
        <div class="col-sm-9 col-md-12">
            <div class="icon-in-input">
                <input type="text" class="form-control" id="search" onclick="initSearchFunctionality()" placeholder="Search..."/>
                <button type="button" class="fa fa-search"></button>
            </div>
        </div>
        <div class="col-sm-3 hidden-md"><button class="btn btn-default btn-block btn-show-all-posts">Show all</button></div>
    </div>
    <hr/>
    <h4 id="searchResultHeader">Search result</h4>
    <div id="searchResult">
    <ul class="nav bs-sidenav">
    </ul>
    <hr/>
    </div>
    <div class="bs-sidebar-hidden-on-mobile">
	{% for nav_item in nav %}
    
			<h4 href="#" class="bs-sidenav-header">{{ nav_item.title }}</h4>
			<ul class="nav bs-sidenav bs-sidenav-group">
			{% for nav_item in nav_item.children %}
				<li {% if nav_item.active %}class="active"{% endif %}>
					<a href="{{ nav_item.url }}">{{ nav_item.title }}</a>
				</li>
			{% endfor %}
			</ul>
	{% endfor %}
    </div>
</div>

<div class="bs-sidebar hidden-print" role="complementary">
    <div class="row">
        <div class="col-sm-9 col-md-12">
            <div class="icon-in-input">
                <input type="text" class="form-control" id="search" onclick="initSearchFunctionality()" placeholder="Search..."/>
                <button type="button" class="fa fa-search"></button>
            </div>
        </div>
        <div class="col-sm-3 hidden-md"><button class="btn btn-default btn-block btn-show-all-posts hidden-lg">Show all</button></div>
    </div>
    <hr/>
    <h4 id="searchResultHeader">Search result</h4>
    <div id="searchResult">
    <ul class="nav bs-sidenav">
    </ul>
    <hr/>
    </div>
    <div class="bs-sidebar-hidden-on-mobile">
	{% for nav_item in nav %}
    
			<h4 href="#" class="bs-sidenav-header">{{ nav_item.title }}</h4>
			<ul class="nav bs-sidenav bs-sidenav-group">
			{% for nav_item in nav_item.children %}
				<li {% if nav_item.active %}class="active"{% endif %}>
					<a href="{{ nav_item.url }}">{{ nav_item.title }}</a>
				</li>
			{% endfor %}
			</ul>
	{% endfor %}
    </div>
</div>

Hide show all button on desktop
Hide show all button on desktop
