Support » Theme: Hueman » Embed CSS Code of Hotel Search Box on Homepage

  • Resolved gaiusf

    (@gaiusf)


    Hi Alex, or anyone expert on this,

    Im creating a travel blog and wanted to insert my affiliated “hotel search box”(booking.com or hotelscombined) on my homepage ideally right on top of the image slider.

    Is there anyone who knows how to do this? would really appreciate any help offer.

    Cheers!

Viewing 7 replies - 1 through 7 (of 7 total)
  • Hi gaiusf. If you’re using the default home page layout, give this a try:
    1. Create a new sidebar in Theme Options > Sidebars; give it a unique id like “hotel-search-box” or whatever you like.
    2. In Widgets, add a text widget to the new sidebar, then place your search box code in the widget.
    3. Copy index.php from the parent theme to your child theme.
    4. In your child theme index.php file, find the following code at the beginning of the file:

    <div class="pad group">
    
    	<?php get_template_part('inc/featured'); ?>

    5. Insert the code to create the search box widget:

    <div class="pad group">
    
    	echo '<div class="my-search-box">';		// create the widget div
    	dynamic_sidebar('hotel-search-box');		// show the widget
    	echo '</div>'; 				// close the widget div
    
    	<?php get_template_part('inc/featured'); ?>

    You can then style and position it using the “my-search-box” class in css.

    hi bdbrown,

    Thanks alot, this is really very helpful. though im not using the child theme and took the risked of editing process on the main theme, i would follow this steps.

    Cheers!

    hi bdbrown,

    – created the sidebar, “sidebar-hotel-search-box”

    – inserted text widget on the new sidebar along with the javascript code of hotel search box. (<script type=’text/javascript’ src=’http://hotel.dboracay.com/SearchBox/127107′></script>) (to make sure, i created a search box that size will definitely fit within.)

    -inserted your code on index.php

    and the result was this. http://dboracay.com/

    did i mess something?

    <div class=”pad group”>

    echo ‘<div class=”my-search-box”>’; // create the widget div
    dynamic_sidebar(‘sidebar-hotel-search-box’); // show the widget
    echo ‘</div>’; // close the widget div

    <?php get_template_part(‘inc/featured’); ?>

    My fault; sorry. We need to enclose it in php, like so:

    <div class="pad group">
    
    	<?php
    		echo '<div class="my-search-box">';		// create the widget div
    		dynamic_sidebar('hotel-search-box');		// show the widget
    		echo '</div>'; 				// close the widget div
    	?>
    
    	<?php get_template_part('inc/featured'); ?>

    bdbrown,

    Cheers! was really great help you made here. I made it! just trying to tweak some paddings. I worked.! *****

    Thanks a lot!

    cheers!

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Embed CSS Code of Hotel Search Box on Homepage’ is closed to new replies.