function ppb_four_images_block_func($atts, $content)
{
    //extract short code attr
    extract(shortcode_atts(array('size' => 'one', 'slug' => '', 'title' => '', 'image1' => '', 'image2' => '', 'image3' => '', 'image4' => '', 'display_caption' => 1, 'padding' => 0, 'bgcolor' => '', 'custom_css' => ''), $atts));
    $sec_id = '';
    if (!empty($slug)) {
        $sec_id = 'id="' . esc_attr($slug) . '"';
    }
    $return_html = '';
    $return_html .= '<div class="standard_wrapper">';
    $return_html .= '<div ' . $sec_id . ' class="' . esc_attr($size) . '" ';
    $custom_css .= 'padding:' . esc_attr($padding) . 'px 0 ' . esc_attr($padding) . 'px 0;';
    if (!empty($bgcolor)) {
        $custom_css .= 'background-color:' . esc_attr($bgcolor) . ';';
    }
    if (!empty($custom_css)) {
        $return_html .= 'style="' . esc_attr(urldecode($custom_css)) . '" ';
    }
    $return_html .= '><div class="page_content_wrapper"><div class="inner">';
    //First image
    $return_html .= '<div class="one_half">';
    if (!empty($image1)) {
        $image_id = pp_get_image_id($image1);
        $image_alt = get_post_meta($image_id, '_wp_attachment_image_alt', true);
        $return_html .= '<div class="image_classic_frame expand animate"><div class="image_wrapper">';
        $return_html .= '<a href="' . esc_url($image1) . '" class="img_frame"><img src="' . esc_url($image1) . '" alt="' . esc_attr($image_alt) . '" class="portfolio_img"/></a>';
        $return_html .= '</div>';
        if (!empty($display_caption)) {
            //Get image meta data
            $image_id = pp_get_image_id($image1);
            $image_caption = get_post_field('post_excerpt', $image_id);
            if (!empty($image_caption)) {
                $return_html .= '<div class="image_caption">' . $image_caption . '</div>';
            }
        }
        $return_html .= '</div>';
    }
    $return_html .= '</div>';
    //Second image
    $return_html .= '<div class="one_half last">';
    if (!empty($image2)) {
        $image_id = pp_get_image_id($image2);
        $image_alt = get_post_meta($image_id, '_wp_attachment_image_alt', true);
        $return_html .= '<div class="image_classic_frame expand animate"><div class="image_wrapper">';
        $return_html .= '<a href="' . esc_url($image2) . '" class="img_frame"><img src="' . esc_url($image2) . '" alt="' . esc_attr($image_alt) . '" class="portfolio_img"/></a>';
        $return_html .= '</div>';
        if (!empty($display_caption)) {
            //Get image meta data
            $image_id = pp_get_image_id($image2);
            $image_caption = get_post_field('post_excerpt', $image_id);
            if (!empty($image_caption)) {
                $return_html .= '<div class="image_caption">' . $image_caption . '</div>';
            }
        }
        $return_html .= '</div>';
    }
    $return_html .= '</div>';
    $return_html .= '<br class="clear"/><br/>';
    //Third image
    $return_html .= '<div class="one_half">';
    if (!empty($image3)) {
        $image_id = pp_get_image_id($image3);
        $image_alt = get_post_meta($image_id, '_wp_attachment_image_alt', true);
        $return_html .= '<div class="image_classic_frame expand animate"><div class="image_wrapper">';
        $return_html .= '<a href="' . esc_url($image3) . '" class="img_frame"><img src="' . esc_url($image3) . '" alt="' . esc_attr($image_alt) . '" class="portfolio_img"/></a>';
        $return_html .= '</div>';
        if (!empty($display_caption)) {
            //Get image meta data
            $image_id = pp_get_image_id($image3);
            $image_caption = get_post_field('post_excerpt', $image_id);
            if (!empty($image_caption)) {
                $return_html .= '<div class="image_caption">' . $image_caption . '</div>';
            }
        }
        $return_html .= '</div>';
    }
    $return_html .= '</div>';
    //Fourth image
    $return_html .= '<div class="one_half last animate">';
    if (!empty($image4)) {
        $image_id = pp_get_image_id($image4);
        $image_alt = get_post_meta($image_id, '_wp_attachment_image_alt', true);
        $return_html .= '<div class="image_classic_frame expand"><div class="image_wrapper">';
        $return_html .= '<a href="' . esc_url($image4) . '" class="img_frame"><img src="' . esc_url($image4) . '" alt="' . esc_attr($image_alt) . '" class="portfolio_img"/></a>';
        $return_html .= '</div>';
        if (!empty($display_caption)) {
            //Get image meta data
            $image_id = pp_get_image_id($image4);
            $image_caption = get_post_field('post_excerpt', $image_id);
            if (!empty($image_caption)) {
                $return_html .= '<div class="image_caption">' . $image_caption . '</div>';
            }
        }
        $return_html .= '</div>';
    }
    $return_html .= '</div>';
    $return_html .= '</div>';
    $return_html .= '</div></div>';
    $return_html .= '</div>';
    $return_html .= '</div>';
    return $return_html;
}
function tg_teaser_func($atts, $content)
{
    extract(shortcode_atts(array('image' => '', 'columns' => 'one_third', 'title' => '', 'align' => '', 'bgcolor' => '', 'fontcolor' => '', 'padding' => ''), $atts));
    $custom_wrapper = '';
    $custom_header = '';
    if (!empty($bgcolor)) {
        $custom_wrapper .= 'background-color:' . esc_attr($bgcolor) . ';';
    }
    if (!empty($fontcolor)) {
        $custom_wrapper .= 'color:' . esc_attr($fontcolor) . ';';
        $custom_header .= 'color:' . esc_attr($fontcolor) . ';';
    }
    if (!empty($padding)) {
        $custom_wrapper .= 'padding:' . esc_attr($padding) . 'px;';
    }
    $return_html = '<div class="teaser_wrapper ' . esc_attr($columns) . ' ' . esc_attr($align) . '" style="' . esc_attr($custom_wrapper) . '">';
    if (!empty($image)) {
        //Get image width and height
        $image_id = pp_get_image_id($image);
        $obj_image = wp_get_attachment_image_src($image_id, 'original');
        $image_width = 0;
        $image_height = 0;
        if (isset($obj_image[1])) {
            $image_width = $obj_image[1];
        }
        if (isset($obj_image[2])) {
            $image_height = $obj_image[2];
        }
        $return_html .= '<img src="' . esc_url($image) . '" alt="" ';
        if ($image_width > 0 && $image_height > 0) {
            $return_html .= 'width="' . $image_width . '" height="' . $image_height . '"';
        }
        $return_html .= ' />';
    }
    if (!empty($title) or !empty($content)) {
        $return_html .= '<div class="teaser_content_wrapper">';
        if (!empty($title)) {
            $return_html .= '<h5 style="' . esc_attr($custom_header) . '">' . $title . '</h5>';
        }
        if (!empty($content)) {
            $return_html .= '<div class="teaser_content">' . do_shortcode($content) . '</div>';
        }
        $return_html .= '</div>';
    }
    $return_html .= '</div>';
    return $return_html;
}
	    	    	<?php 
    }
    ?>
	    	    </a>
    		</div>
    	</div>
    	<?php 
}
?>
    	
    	<?php 
//get custom logo transparent
$tg_retina_transparent_logo = kirki_get_option('tg_retina_transparent_logo');
if (!empty($tg_retina_transparent_logo)) {
    //Get image width and height
    $image_id = pp_get_image_id($tg_retina_transparent_logo);
    $obj_image = wp_get_attachment_image_src($image_id, 'original');
    $image_width = 0;
    $image_height = 0;
    if (isset($obj_image[1])) {
        $image_width = intval($obj_image[1] / 2);
    }
    if (isset($obj_image[2])) {
        $image_height = intval($obj_image[2] / 2);
    }
    ?>
    	<div id="logo_transparent" class="logo_container">
    		<div class="logo_align">
	    	    <a id="custom_logo_transparent" class="logo_wrapper <?php 
    if (empty($page_menu_transparent)) {
        ?>
**/
$current_page = get_page($post->ID);
$current_page_id = '';
if (isset($current_page->ID)) {
    $current_page_id = $current_page->ID;
}
global $pp_contact_display_map;
//Check if hide header on this page
$page_hide_header = get_post_meta($current_page_id, 'page_hide_header', true);
if (empty($page_hide_header)) {
    //Check if post has featured image
    $page_header_background = get_post_meta($current_page_id, 'page_header_background', true);
    $page_tagline = get_post_meta($current_page_id, 'page_tagline', true);
    $pp_page_bg = '';
    if (!empty($page_header_background) && empty($pp_contact_display_map)) {
        $image_id = pp_get_image_id($page_header_background);
        $image_thumb = wp_get_attachment_image_src($image_id, 'original', true);
        $pp_page_bg = $image_thumb[0];
        $background_image = $image_thumb[0];
        $background_image_width = $image_thumb[1];
        $background_image_height = $image_thumb[2];
        ?>
	<div id="page_caption" <?php 
        if (!empty($pp_page_bg)) {
            ?>
 data-stellar-background-ratio="0.5" style="background-image:url('<?php 
            echo esc_url($background_image);
            ?>
');" class="hasbg parallax"<?php 
        }
        ?>
function ppb_three_images_block_func($atts, $content)
{
    //extract short code attr
    extract(shortcode_atts(array('size' => 'one', 'title' => '', 'image_portrait' => '', 'image_portrait_align' => 'left', 'image2' => '', 'image3' => '', 'display_caption' => 1, 'custom_css' => ''), $atts));
    if (empty($image_portrait_align)) {
        $image_portrait_align = 'left';
    }
    $return_html = '<div class="' . esc_attr($size) . '" ';
    if (!empty($custom_css)) {
        $return_html .= 'style="' . urldecode(esc_attr($custom_css)) . '" ';
    }
    $return_html .= '><div class="page_content_wrapper"><div class="inner">';
    if ($image_portrait_align == 'left') {
        //First column
        $return_html .= '<div class="one_half">';
        if (!empty($image_portrait)) {
            $return_html .= '<div class="image_classic_frame expand animate"><div class="image_wrapper">';
            $return_html .= '<a href="' . esc_url($image_portrait) . '" class="img_frame"><img src="' . esc_url($image_portrait) . '" alt="" class="portfolio_img"/></a>';
            $return_html .= '</div>';
            if (!empty($display_caption)) {
                //Get image meta data
                $image_id = pp_get_image_id($image_portrait);
                $image_caption = get_post_field('post_excerpt', $image_id);
                if (!empty($image_caption)) {
                    $return_html .= '<div class="image_caption">' . $image_caption . '</div>';
                }
            }
            $return_html .= '</div>';
        }
        $return_html .= '</div>';
        //Second column
        $return_html .= '<div class="one_half last">';
        if (!empty($image2)) {
            $return_html .= '<div class="image_classic_frame expand animate"><div class="image_wrapper">';
            $return_html .= '<a href="' . esc_url($image2) . '" class="img_frame"><img src="' . esc_url($image2) . '" alt="" class="portfolio_img"/></a>';
            $return_html .= '</div>';
            if (!empty($display_caption)) {
                //Get image meta data
                $image_id = pp_get_image_id($image2);
                $image_caption = get_post_field('post_excerpt', $image_id);
                if (!empty($image_caption)) {
                    $return_html .= '<div class="image_caption">' . $image_caption . '</div>';
                }
            }
            $return_html .= '</div>';
        }
        $return_html .= '<br class="clear"/>';
        if (!empty($image3)) {
            $return_html .= '<div class="image_classic_frame expand animate"><div class="image_wrapper">';
            $return_html .= '<a href="' . esc_url($image3) . '" class="img_frame"><img src="' . esc_url($image3) . '" alt="" class="portfolio_img"/></a>';
            $return_html .= '</div>';
            if (!empty($display_caption)) {
                //Get image meta data
                $image_id = pp_get_image_id($image3);
                $image_caption = get_post_field('post_excerpt', $image_id);
                if (!empty($image_caption)) {
                    $return_html .= '<div class="image_caption">' . $image_caption . '</div>';
                }
            }
            $return_html .= '</div>';
        }
        $return_html .= '</div>';
    } else {
        //First column
        $return_html .= '<div class="one_half">';
        if (!empty($image2)) {
            $return_html .= '<div class="image_classic_frame expand animate"><div class="image_wrapper">';
            $return_html .= '<a href="' . esc_url($image2) . '" class="img_frame"><img src="' . esc_url($image2) . '" alt="" class="portfolio_img"/></a>';
            $return_html .= '</div>';
            if (!empty($display_caption)) {
                //Get image meta data
                $image_id = pp_get_image_id($image2);
                $image_caption = get_post_field('post_excerpt', $image_id);
                if (!empty($image_caption)) {
                    $return_html .= '<div class="image_caption">' . $image_caption . '</div>';
                }
            }
            $return_html .= '</div>';
        }
        $return_html .= '<br class="clear"/>';
        if (!empty($image3)) {
            $return_html .= '<div class="image_classic_frame expand animate"><div class="image_wrapper">';
            $return_html .= '<a href="' . esc_url($image3) . '" class="img_frame"><img src="' . esc_url($image3) . '" alt="" class="portfolio_img"/></a>';
            $return_html .= '</div>';
            if (!empty($display_caption)) {
                //Get image meta data
                $image_id = pp_get_image_id($image3);
                $image_caption = get_post_field('post_excerpt', $image_id);
                if (!empty($image_caption)) {
                    $return_html .= '<div class="image_caption">' . $image_caption . '</div>';
                }
            }
            $return_html .= '</div>';
        }
        $return_html .= '</div>';
        //Second column
        $return_html .= '<div class="one_half last">';
        if (!empty($image_portrait)) {
            $return_html .= '<div class="image_classic_frame expand animate"><div class="image_wrapper">';
            $return_html .= '<a href="' . esc_url($image_portrait) . '" class="img_frame"><img src="' . esc_url($image_portrait) . '" alt="" class="portfolio_img"/></a>';
            $return_html .= '</div>';
            if (!empty($display_caption)) {
                //Get image meta data
                $image_id = pp_get_image_id($image_portrait);
                $image_caption = get_post_field('post_excerpt', $image_id);
                if (!empty($image_caption)) {
                    $return_html .= '<div class="image_caption">' . $image_caption . '</div>';
                }
            }
            $return_html .= '</div>';
        }
        $return_html .= '</div>';
    }
    $return_html .= '<br class="clear"/>';
    //Display Title
    if (!empty($title)) {
        $return_html .= '<br/><br/><h2 class="ppb_title animate">' . $title . '</h2>';
    }
    //Display Content
    if (!empty($title)) {
        $return_html .= '<div class="animate">' . do_shortcode(tg_apply_content($content)) . '</div>';
    }
    $return_html .= '</div>';
    $return_html .= '</div>';
    $return_html .= '</div>';
    return $return_html;
}
            echo esc_url($pp_retina_logo);
            ?>
" alt="<?php 
            echo esc_attr($image_alt);
            ?>
" width="<?php 
            echo esc_attr($pp_retina_logo_width);
            ?>
" height="<?php 
            echo esc_attr($pp_retina_logo_height);
            ?>
"/>
    </a>
<?php 
        } else {
            $pp_logo_id = pp_get_image_id($pp_logo);
            $image_alt = get_post_meta($pp_logo_id, '_wp_attachment_image_alt', true);
            ?>
    <a id="custom_logo" class="logo_wrapper" href="<?php 
            echo esc_url(home_url());
            ?>
">
    	<img src="<?php 
            echo esc_url($pp_logo);
            ?>
" alt="<?php 
            echo esc_attr($image_alt);
            ?>
"/>
    </a>
<?php 
        $page_title = __('Blog Archives', THEMEDOMAIN);
    }
    $term = 'archive';
}
if (empty($page_hide_header) && ($page_revslider == -1 or empty($page_revslider) or !empty($page_header_below))) {
    $pp_page_bg = '';
    //Get page featured image
    if (has_post_thumbnail($current_page_id, 'full') && empty($term) && empty($pp_contact_display_map)) {
        $image_id = get_post_thumbnail_id($current_page_id);
        $image_thumb = wp_get_attachment_image_src($image_id, 'full', true);
        $pp_page_bg = $image_thumb[0];
    }
    if (isset($_GET['action']) && $_GET['action'] == 'pp_tour_search') {
        $pp_tour_search_bg = get_option('pp_tour_search_bg');
        if (!empty($pp_tour_search_bg)) {
            $image_id = pp_get_image_id($pp_tour_search_bg);
            $image_thumb = wp_get_attachment_image_src($image_id, 'full', true);
            $pp_page_bg = $image_thumb[0];
        }
    }
    if (isset($image_thumb[0])) {
        $background_image = $image_thumb[0];
        $background_image_width = $image_thumb[1];
        $background_image_height = $image_thumb[2];
    }
    global $global_pp_topbar;
    ?>
<div id="page_caption" <?php 
    if (!empty($pp_page_bg)) {
        ?>
class="hasbg parallax <?php 
        }
        ?>
				<h1><?php 
        echo $page_title;
        ?>
</h1>
			</div>
		</div>
<?php 
    } elseif (is_tag()) {
        $pp_bg_tags = get_option('pp_bg_tags');
        $page_title = single_cat_title('', false);
        $page_tagline = __('Posts tagged ', THEMEDOMAIN) . single_cat_title('', false);
        if (!empty($pp_bg_tags)) {
            $pp_page_bg = $pp_bg_tags;
            $image_id = pp_get_image_id($pp_page_bg);
            $image_thumb = wp_get_attachment_image_src($image_id, 'original', true);
            $pp_page_bg = $image_thumb[0];
            $background_image = $image_thumb[0];
            $background_image_width = $image_thumb[1];
            $background_image_height = $image_thumb[2];
        }
        ?>
		<div id="page_caption" <?php 
        if (!empty($pp_page_bg)) {
            ?>
 data-stellar-background-ratio="0.5" style="background-image:url('<?php 
            echo esc_url($background_image);
            ?>
');" class="hasbg parallax"<?php 
        }
get_header();
global $global_pp_topbar;
/**
*	Get current page id
**/
$current_page_id = $post->ID;
?>

<?php 
$page_menu_transparent = get_post_meta($current_page_id, 'post_menu_transparent', true);
$pp_page_bg = '';
//Get page featured image
$post_header_background = get_post_meta($current_page_id, 'post_header_background', true);
if (!empty($post_header_background)) {
    //Get image width and height
    $post_header_background_id = pp_get_image_id($post_header_background);
    $post_header_background_image = wp_get_attachment_image_src($post_header_background_id, 'original');
    $background_image = $post_header_background_image[0];
    $background_image_width = $post_header_background_image[1];
    $background_image_height = $post_header_background_image[2];
}
//Check if display post featured imageas background
if (isset($background_image[0]) && !empty($background_image[0])) {
    $pp_page_bg = $background_image[0];
}
?>

<div id="page_caption" <?php 
if (!empty($pp_page_bg)) {
    ?>
class="hasbg parallax <?php 
示例#10
0
				
				<?php 
    //get custom logo transparent
    $pp_logo_transparent = get_option('pp_logo_transparent');
    $pp_retina_logo_transparent = get_option('pp_retina_logo_transparent');
    $pp_retina_logo_transparent_width = 0;
    $pp_retina_logo_transparent_height = 0;
    if (empty($pp_logo_transparent) && empty($pp_retina_logo_transparent)) {
        $pp_retina_logo_transparent = get_template_directory_uri() . '/images/logo@2x_white.png';
        $pp_retina_logo_transparent_width = 69;
        $pp_retina_logo_transparent_height = 33;
    }
    if (!empty($pp_retina_logo_transparent)) {
        if (empty($pp_retina_logo_transparent_width) && empty($pp_retina_logo_transparent_width)) {
            //Get image width and height
            $pp_retina_logo_transparent_id = pp_get_image_id($pp_retina_logo_transparent);
            $image_logo = wp_get_attachment_image_src($pp_retina_logo_transparent_id, 'original');
            $pp_retina_logo_transparent = $image_logo[0];
            $pp_retina_logo_transparent_width = $image_logo[1] / 2;
            $pp_retina_logo_transparent_height = $image_logo[2] / 2;
        }
        ?>
		
				    <a id="custom_logo_transparent" class="logo_wrapper <?php 
        if (!$use_transparent_logo) {
            ?>
hidden<?php 
        } else {
            ?>
default<?php 
        }
示例#11
0
<!-- Begin logo -->	
<?php 
        //get custom logo
        $pp_logo = get_option('pp_logo');
        $pp_retina_logo = get_option('pp_retina_logo');
        $pp_retina_logo_width = 0;
        $pp_retina_logo_height = 0;
        if (empty($pp_logo) && empty($pp_retina_logo)) {
            $pp_retina_logo = get_template_directory_uri() . '/images/logo@2x.png';
            $pp_retina_logo_width = 173;
            $pp_retina_logo_height = 66;
        }
        if (!empty($pp_retina_logo)) {
            if (empty($pp_retina_logo_width) && empty($pp_retina_logo_height)) {
                //Get image width and height
                $pp_retina_logo_id = pp_get_image_id($pp_retina_logo);
                $image_logo = wp_get_attachment_image_src($pp_retina_logo_id, 'original');
                $pp_retina_logo = $image_logo[0];
                $pp_retina_logo_width = intval($image_logo[1] / 2);
                $pp_retina_logo_height = intval($image_logo[2] / 2);
            }
            ?>
		
    <a id="custom_logo" class="logo_wrapper" href="<?php 
            echo esc_url(home_url());
            ?>
">
    	<img src="<?php 
            echo esc_url($pp_retina_logo);
            ?>
" alt="" width="<?php 
示例#12
0
<?php

$absolute_path = __FILE__;
$path_to_file = explode('wp-content', $absolute_path);
$path_to_wp = $path_to_file[0];
require_once $path_to_wp . '/wp-load.php';
$do_blur = FALSE;
if (isset($_GET['src']) && !empty($_GET['src'])) {
    $image_id = pp_get_image_id($_GET['src']);
    if (!empty($image_id)) {
        $do_blur = TRUE;
    }
}
$blurFactor = 5;
if (isset($_GET['blur_factor']) && is_numeric($_GET['blur_factor'])) {
    $blurFactor = $_GET['blur_factor'];
}
function blur($gdImageResource, $blurFactor = 3)
{
    // blurFactor has to be an integer
    $blurFactor = round($blurFactor);
    $originalWidth = imagesx($gdImageResource);
    $originalHeight = imagesy($gdImageResource);
    $smallestWidth = ceil($originalWidth * pow(0.5, $blurFactor));
    $smallestHeight = ceil($originalHeight * pow(0.5, $blurFactor));
    // for the first run, the previous image is the original input
    $prevImage = $gdImageResource;
    $prevWidth = $originalWidth;
    $prevHeight = $originalHeight;
    // scale way down and gradually scale back up, blurring all the way
    for ($i = 0; $i < $blurFactor; $i += 1) {
function tg_lightbox_func($atts, $content)
{
    extract(shortcode_atts(array('type' => 'image', 'src' => '', 'href' => '', 'youtube_id' => '', 'vimeo_id' => ''), $atts));
    $class = 'lightbox';
    if ($type != 'image') {
        $class .= '_' . $type;
    }
    if ($type == 'youtube') {
        $href = '#video_' . $youtube_id;
    }
    if ($type == 'vimeo') {
        $href = '#video_' . $vimeo_id;
    }
    $return_html = '<div class="post_img">';
    $return_html .= '<a href="' . $href . '" class="img_frame">';
    if (!empty($src)) {
        $image_id = pp_get_image_id($src);
        $image_alt = get_post_meta($image_id, '_wp_attachment_image_alt', true);
        if (!is_string($image_alt)) {
            $image_alt = '';
        }
        $return_html .= '<img src="' . esc_url($src) . ' alt="' . esc_attr($image_alt) . '" class="img_frame"/>';
    }
    if (!empty($youtube_id)) {
        $return_html .= '<div style="display:none;"><div id="video_' . $youtube_id . '" style="width:900px;height:488px;overflow:hidden;" class="video-container"><iframe width="900" height="488" src="http://www.youtube.com/embed/' . $youtube_id . '?theme=dark&amp;rel=0&amp;wmode=opaque" frameborder="0"></iframe></div></div>';
    }
    if (!empty($vimeo_id)) {
        $return_html .= '<div style="display:none;"><div id="video_' . $vimeo_id . '" style="width:900px;height:506px;overflow:hidden;" class="video-container"><iframe src="http://player.vimeo.com/video/' . $vimeo_id . '?title=0&amp;byline=0&amp;portrait=0" width="900" height="506" frameborder="0"></iframe></div></div>';
    }
    $return_html .= '</a></div>';
    return $return_html;
}
function ppb_contact_func($atts, $content)
{
    //extract short code attr
    extract(shortcode_atts(array('title' => '', 'address' => '', 'background' => '', 'background_parallax' => 'none', 'custom_css' => ''), $atts));
    $return_html = '<div class="one withsmallpadding ';
    if (!empty($background)) {
        $return_html .= 'withbg ';
    }
    if (!empty($background_parallax)) {
        $return_html .= 'parallax';
    }
    $return_html .= '" ';
    $parallax_data = '';
    //Get image width and height
    $background = esc_url($background);
    $pp_background_image_id = pp_get_image_id($background);
    if (!empty($pp_background_image_id)) {
        $background_image_arr = wp_get_attachment_image_src($pp_background_image_id, 'original');
        $background_image = $background_image_arr[0];
        $background_image_width = $background_image_arr[1];
        $background_image_height = $background_image_arr[2];
    } else {
        $background_image = $background;
        $background_image_width = '';
        $background_image_height = '';
    }
    //Check parallax background
    switch ($background_parallax) {
        case 'scroll_pos':
        case 'mouse_pos':
        case 'scroll_pos':
        case 'mouse_scroll_pos':
            $parallax_data = ' data-image="' . esc_attr($background_image) . '" data-width="' . esc_attr($background_image_width) . '" data-height="' . esc_attr($background_image_height) . '"';
            break;
    }
    if ((empty($background_parallax) or $background_parallax == 'none') && !empty($background)) {
        $return_html .= 'style="background-image:url(' . $background_image . ');background-size:cover;" ';
    }
    if (!empty($custom_css)) {
        $return_html .= 'style="' . urldecode($custom_css) . '" ';
    }
    $return_html .= $parallax_data;
    $return_html .= '>';
    $return_html .= '<div class="page_content_wrapper" style="text-align:center">';
    //Display Title
    if (!empty($title)) {
        $return_html .= '<h2 class="ppb_title">' . $title . '</h2>';
    }
    //Display Content
    if (!empty($content)) {
        $return_html .= '<div class="page_caption_desc">' . $content . '</div>';
    }
    //Display Horizontal Line
    if (empty($content)) {
        $return_html .= '<br/><br/>';
    }
    $return_html .= '<div style="text-align:left">';
    //Displat address
    $return_html .= '<div class="one_half">';
    $return_html .= do_shortcode(tg_apply_content(urldecode($address)));
    $return_html .= '</div>';
    //Display contact form
    $return_html .= '<div class="one_half last">';
    //Get contact form random ID
    $custom_id = time() . rand();
    $pp_contact_form = unserialize(get_option('pp_contact_form_sort_data'));
    wp_enqueue_script("jquery.validate", get_template_directory_uri() . "/js/jquery.validate.js", false, THEMEVERSION, true);
    wp_register_script("script-contact-form", get_template_directory_uri() . "/templates/script-contact-form.php?form=" . $custom_id . '&amp;skin=dark', false, THEMEVERSION, true);
    $params = array('ajaxurl' => admin_url('admin-ajax.php'), 'ajax_nonce' => wp_create_nonce('tgajax-post-contact-nonce'));
    wp_localize_script('script-contact-form', 'tgAjax', $params);
    wp_enqueue_script("script-contact-form", get_template_directory_uri() . "/templates/script-contact-form.php?form=" . $custom_id . '&amp;skin=dark', false, THEMEVERSION, true);
    $return_html .= '<div id="reponse_msg_' . $custom_id . '" class="contact_form_response"><ul></ul></div>';
    $return_html .= '<form id="contact_form_' . $custom_id . '" class="contact_form_wrapper" method="post" action="/wp-admin/admin-ajax.php">';
    $return_html .= '<input type="hidden" id="action" name="action" value="pp_contact_mailer"/>';
    if (is_array($pp_contact_form) && !empty($pp_contact_form)) {
        foreach ($pp_contact_form as $form_input) {
            switch ($form_input) {
                case 1:
                    $return_html .= '<label for="your_name">' . __('Name *', THEMEDOMAIN) . '</label>
    				<input id="your_name" name="your_name" type="text" class="required_field" placeholder="' . __('Name *', THEMEDOMAIN) . '"/>
    				';
                    break;
                case 2:
                    $return_html .= '<label for="email">' . __('Email *', THEMEDOMAIN) . '</label>
    				<input id="email" name="email" type="text" class="required_field email" placeholder="' . __('Email *', THEMEDOMAIN) . '"/>
    				';
                    break;
                case 3:
                    $return_html .= '<label for="message">' . __('Message *', THEMEDOMAIN) . '</label>
    				<textarea id="message" name="message" rows="7" cols="10" class="required_field" style="width:91%;" placeholder="' . __('Message *', THEMEDOMAIN) . '"></textarea>
    				';
                    break;
                case 4:
                    $return_html .= '<label for="address">' . __('Address', THEMEDOMAIN) . '</label>
    				<input id="address" name="address" type="text" placeholder="' . __('Address', THEMEDOMAIN) . '"/>
    				';
                    break;
                case 5:
                    $return_html .= '<label for="phone">' . __('Phone', THEMEDOMAIN) . '</label>
    				<input id="phone" name="phone" type="text" placeholder="' . __('Phone', THEMEDOMAIN) . '"/>
    				';
                    break;
                case 6:
                    $return_html .= '<label for="mobile">' . __('Mobile', THEMEDOMAIN) . '</label>
    				<input id="mobile" name="mobile" type="text" placeholder="' . __('Mobile', THEMEDOMAIN) . '"/>
    				';
                    break;
                case 7:
                    $return_html .= '<label for="company">' . __('Company Name', THEMEDOMAIN) . '</label>
    				<input id="company" name="company" type="text" placeholder="' . __('Company Name', THEMEDOMAIN) . '"/>
    				';
                    break;
                case 8:
                    $return_html .= '<label for="country">' . __('Country', THEMEDOMAIN) . '</label>				
    				<input id="country" name="country" type="text" placeholder="' . __('Country', THEMEDOMAIN) . '"/>
    				';
                    break;
            }
        }
    }
    $pp_contact_enable_captcha = get_option('pp_contact_enable_captcha');
    if (!empty($pp_contact_enable_captcha)) {
        $return_html .= '<div id="captcha-wrap">
    		<div class="captcha-box">
    			<img src="' . get_stylesheet_directory_uri() . '/get_captcha.php" alt="" id="captcha" />
    		</div>
    		<div class="text-box">
    			<label>Type the two words:</label>
    			<input name="captcha-code" type="text" id="captcha-code">
    		</div>
    		<div class="captcha-action">
    			<img src="' . get_stylesheet_directory_uri() . '/images/refresh.jpg"  alt="" id="captcha-refresh" />
    		</div>
    	</div>
    	<br class="clear"/><br/><br/>';
    }
    $return_html .= '<br/><br/><p>
    	<input id="contact_submit_btn" type="submit" class="solidbg" value="' . __('Send', THEMEDOMAIN) . '"/>
    </p>';
    $return_html .= '</form>';
    $return_html .= '</div>';
    $return_html .= '</div>';
    $return_html .= '</div>';
    $return_html .= '</div>';
    return $return_html;
}
示例#15
0
?>

<?php 
/**
*	Get current page id
**/
$current_page_id = $post->ID;
$portfolio_gallery_id = get_post_meta($current_page_id, 'portfolio_gallery_id', true);
?>

<?php 
//Check if post has featured image
$portfolio_header_background = get_post_meta($current_page_id, 'portfolio_header_background', true);
$pp_page_bg = '';
if (!empty($portfolio_header_background)) {
    $image_id = pp_get_image_id($portfolio_header_background);
    $image_thumb = wp_get_attachment_image_src($image_id, 'original', true);
    $pp_page_bg = $image_thumb[0];
    $background_image = $image_thumb[0];
    $background_image_width = $image_thumb[1];
    $background_image_height = $image_thumb[2];
    ?>
<div id="page_caption" <?php 
    if (!empty($pp_page_bg)) {
        ?>
 data-stellar-background-ratio="0.5" style="background-image:url('<?php 
        echo esc_url($background_image);
        ?>
');" class="hasbg parallax"<?php 
    }
    ?>