Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- //my shortcode
- function offer_menu($atts, $content = null, $tag)
- {
- extract(shortcode_atts(array(
- 'bg_image' => '',
- 'title' => 'Hotel Obaffo',
- 'address' => 'London',
- 'rating' => '9',
- 'price' => '80',
- 'priceroomtitle' => 'Price per room per night from',
- 'client_url' => 'true',
- 'montent' => ''
- ), $atts));
- $get_bg='';
- if (isset($bg_image) && $bg_image != '')
- {
- $get_bg1 = wp_get_attachment_image_src($bg_image, 'bg_image');
- $get_bg=$get_bg1[0];
- }
- $client_url = vc_build_link($client_url);
- $output = '';
- $output.='<article class="one-fourth">
- <figure>
- <a href="' . $client_url['url'] . '" title="">
- <img src= "' . $get_bg . '" alt="" />
- </a>
- </figure>
- <div class="details">
- <h3>' . $title . '<span class="stars">
- <i class="material-icons"></i>
- <i class="material-icons"></i>
- <i class="material-icons"></i>
- <i class="material-icons"></i>
- <i class="material-icons"></i>
- </span>
- </h3>
- <span class="address">' . $address . ' • <a href="#">Show on map</a></span>
- <span class="rating">' . $rating . '/10</span>
- <span class="price">' . $priceroomtitle . '<em>$' . $price . '</em> </span>
- <div class="description">
- <p>' . $montent . '</p>
- </div>
- <a href="' . $client_url['url'] . '" title="Book now" class="gradient-button" target="">Book now</a>
- </div>
- </article> ';
- return $output;
- }
- add_shortcode('offer', 'offer_menu');
- ////////////////////
- vc_map(array(
- 'name' => 'View Offer',
- 'base' => 'offer',
- 'icon' => get_template_directory_uri() . '/img/offer.png',
- 'params' => array(
- array(
- 'param_name' => 'bg_image',
- 'type' => 'attach_image',
- 'heading' => 'Put an Image',
- 'value' => __('')
- ),
- array(
- 'param_name' => 'title',
- 'type' => 'textfield',
- 'heading' => 'Give a Hotel Name'
- ),
- array(
- 'param_name' => 'address',
- 'type' => 'textfield',
- 'heading' => 'Write address here'
- ),
- array(
- 'param_name' => 'rating',
- 'type' => 'dropdown',
- 'heading' => 'Give a rating',
- 'value' => array(
- '1' => '1',
- '2' => '2',
- '3' => '3',
- '4' => '4',
- '5' => '5',
- '6' => '6',
- '7' => '7',
- '8' => '8',
- '9' => '9',
- '10' => '10'
- )
- ),
- array(
- 'param_name' => 'price',
- 'type' => 'textfield',
- 'heading' => 'Put a price '
- ),
- array(
- 'param_name' => 'montent',
- 'type' => 'textarea',
- 'heading' => 'Write a brife content '
- ),
- array(
- 'param_name' => 'client_url',
- 'type' => 'vc_link',
- 'heading' => __('Give a link'),
- 'description' => __('Add link to custom heading.', 'js_composer')
- ),
- array(
- 'param_name' => 'priceroomtitle',
- 'type' => 'textfield',
- 'heading' => 'Put text'
- )
- )
- ));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement