You can call the plugin results and search form as php code as follows.

First of all, you need to include the php file “bookinginc.php” which is inside plugin folder.

<?php
include (PLUGINPATH/PLUGINNAME/bookinginc.php);
?>

With a standard installation of the plug-in, the suggested code is the follow:

<?php
include (ABSPATH."wp-content/plugins/HotelsNearYou[Booking.Com]/bookinginc.php");
?>

Hotel listing

We offer two different functions:

  • Bookingcomhotels_html() – for results in HTML data.
  • Bookingcomhotels() – for results in array data.

Both functions have the following parameters:

  • 1st argument- List Title.
  • 2nd argument – No. of hotels to display (integer value).
  • 3rd argument – latitude.
  • 4th argument – longitude.
  • 5th argument – Radius (in meters).
  • 6th argument – Refferal Aid.
  • 7th argument – Extraction of data in various mode:
    • rand – for random
    • asc - for ascending order of distance from given longitude and latitude
    • desc – for descending order of distance from given longitude and latitude
  • 8th argument – image size to display:
    • square60 – for 60×60 image
    • max300 – for 300×300 image
    • original – for original image
  • 9th argument – (this is optional) Target for the link. With this option is possible to decide if the hotel details (in booking.com web site) shall be displayed in the same window or in a new window (using ”_blank” as value will open link in new window, otherwise will open link in the same window).
  • 10th argument – (this is optional ) City ids in comma separtaed fashion (for e,g ‘-13457,-23456’). This will limit the hotels to this city ids only.
  • 11nd (this is optional) Nofollow. If nofollow is set, this add the rel=”nofollow” link to the destination hotel link.
  • 12nd (this is optional) Description length. If is set (integer number), will limit the description lenght to the selected characters.
  • 13rd argument – (this is optional) Language code. If there is no WPML or no default language is set in wordpress you can specify here language code to show the result in this language code. This only take in effect when there is no WPML or default language in wordpress.

Examples

<?php
//HTML Data
Bookingcomhotels_html('Hotels',10,'45.434124857','12.3318958282',500,305683,'rand','square60','_blank','nofollow','300');
?>
<?php
//Hotel array
$hotelarray = Bookingcomhotels('Hotels',10,'45.434124857','12.3318958282',500,305683,'rand','square60');
?>

Hotel search

For search form you can call the function BookingcomSearch() that display the search form and accepts the following arguments:

  • 1st argument- Search result page. You have to specify the link of the page where search results can be displayed. This page should contain the tag- [hny-booking searchresults] which will be replaced by search results. You can create a new page and put this tag in that page provide url here.
  • 2nd argument – Button title. For e.g. “Search”.
  • 3rd argument – City ids. You can provide now city ids in comma separated form enclosed list in single quote.

Example

<?php BookingcomSearch('http://www.hotelsnearyou.info/?p=xxxx','Search','-120151,-120152'); ?>

Random from portfolio

Christmas Markets

We bought this great plugin for our new web site dedicated to Christmas Markets all around Italy and Europe, www.mercatini-natalizi.it. In each city presented we have inserted the shortcodes to show some hotels. We can choose the number of the hot...