1. Home
  2. Docs
  3. WebHotelier for WordPress
  4. Shortcode

Shortcode

WebHotelier for WordPress can be used via shortcodes or via widgets.

The default shortcode is the following:

[wp-webhotelier]

In order to add a shortcode there are many ways to do so in WordPress.

  • If you use the classic editor it should look like this.
  • If you use Gutenberg and you want to add it, using the shortcode block, you can can press on Shortcode as you see below.
  • This shortcode will generate a form based on the values that you have provided as you can see below. For any value that has not been provided the form will assume the default values that have been set through the plugin’s admin menu. After that the only thingy you have to do is to add the shortcode like that.
  • If you use Gutenberg but you want to add it as a widget block, you can do that like this.You can see in the image below how to make any customization.

Arguments

All the arguments you use inside a shortcode will override the defaults that have been set through the plugin’s admin menu.

  1. [wp-webhotelier url="https://example.reserve-online.net"]

    The url argument is for directing to which WebHotelier account shall the form search for availability. All WebHotelier accounts end with the domain “reserve-online.net”.

  2. [wp-webhotelier max-adults="5"]

    The max-adults argument is for defining the maximum number of adults that your website visitor can choose in your form. You can type any number within reason as a value. If you type 0 then there won’t be an adults selection box in the form.

  3. [wp-webhotelier max-children="5"]

    The max-children argument is for defining the maximum number of children that your website visitor can choose in your form. You can type any number within reason as a value. If you type 0 then there won’t be a children selection box in the form.

  4. [wp-webhotelier max-infants="5"]

    The max-infants argument is for defining the maximum number of infants that your website visitor can choose in your form. You can type any number within reason as a value. If you type 0 then there won’t be an infants selection box in the form.

  5. [wp-webhotelier orientation="fluid"]

    The orientation argument is for defining the layout of the form. You can choose between horizontal, vertical or fluid. The orientation is exclusively dependent on your design needs. The “fluid” option is a safe choice for shortcodes in case you have any doubts on what you should choose. Vertical orientation is at best in sections with small width. You can see below an example of each orientation.

    Fluid orientation

    Horizontal orientation

    Vertical orientation
  6. [wp-webhotelier checkout-date="true"]

    The checkout-date argument is for choosing whether you would like your visitors to pick a checkout date or choose how many nights they want to spend at the hotel. Do not set it to “false” if you want to display “Nights”, instead just omit it entirely.

  7. [wp-webhotelier max-nights="10"]

    The max-nights argument is for defining the maximum number of nights that your website visitor can choose to spend at the hotel. You can type any number within reason as a value. However, if you have also set the “checkout-date” to true then this argument won’t have any effect.

  8. [wp-webhotelier css-class="my-class"]

    The css-class argument is for adding a CSS Class of your choosing to the “form” element. This way you are able to target that specific form and style it however you want. You are not limited into using just one class, you can freely add multiple classes separating them by a space e.g. css-class=”my-class my-second-class”.

  9. The days-after-checkin-allowed argument is used when you want to enforce that customers can book from your property only after the amount of days that you have specified. So if 0 is selected then the customer is allowed to check-in today, if 1 is selected then the customer is allowed to check-in one day after today, so tommorow and so on. The default value for the field is 1. An example of allowing the guests to book from the today, so that this option must be set to zero can be seen below.

     [wp-webhotelier days-after-checkin-allowed="0"]
  10. The opening-closing-dates argument is used to define the period which your hotel is open, and bookings are allowed. It also assists the visitor by setting as starting date the first date that your hotel is actually open, so that there is no need to scan through the whole year to locate the dates that your hotel actually opens. We know that this is a very pleasant surprise for your guests. In order to set the dates you will have to use the following format: “YYYY-mm-dd to YYYY-mm-dd” where the first date will be the opening date while the second one will be the closing. The format is strict. For example if your hotel opens on March 15 and closes on October 20 of the year 2020, then the shortcode should look like this:

    [wp-webhotelier opening-closing-dates="2020-03-15 to 2020-10-20"]

    If your hotel opens on November 08 of 2019 and closes on March 18 of 2020, then the shorcode should look like this:

    [wp-webhotelier opening-closing-dates="2019-11-08 to 2020-03-18"]

    One important note, if you set the dates and the next year you forget to change the year in the shorcode, the plugin is smart enough to figure that out. If the dates that the hotel is open change, the plugin is not smart enough and you must change the dates for the plugin to work correctly.

  11. [wp-webhotelier display-blank="1"]

    The display-blank argument is used to define whether the visitor’s browser should open a new tab for the WebHotelier results or stay in the same page. Set it to “1” if you want a new tab or to “0” if you want to stay in the same tab.

Was this article helpful to you? No Yes

How can we help?