Example #1
0
function outdoor_lightbox_img_shortcode($atts, $content = '')
{
    extract(shortcode_atts(array('title' => '', 'img' => '', 'img_mini' => '', 'width' => '', 'height' => '', 'img_style' => '', 'group' => ''), $atts));
    $img_mini = '' != $img_mini ? $img_mini : $img;
    $width = '' != $width ? ' width="' . esc_attr($width) . '"' : '';
    $height = '' != $height ? ' height="' . esc_attr($height) . '"' : '';
    $group = '' != $group ? 'rel="' . esc_attr($group) . '"' : '';
    switch ($img_style) {
        case 'rounded':
            $img_style = ' img-rounded';
            break;
        case 'circle':
            $img_style = ' img-circle';
            break;
        case 'thumb':
            $img_style = ' img-thumbnail';
            break;
        default:
            $img_style = '';
    }
    ob_start();
    // End php code
    ?>

    <?php 
    if ($img != '') {
        ?>
        <a class="fancybox" <?php 
        echo $group;
        ?>
 href="<?php 
        echo esc_url($img);
        ?>
" title="<?php 
        echo esc_attr($title);
        ?>
">
            <img class="<?php 
        echo outdoor_retina_class(), esc_attr($img_style);
        ?>
" src="<?php 
        echo esc_url($img_mini);
        ?>
" <?php 
        echo $width, $height;
        ?>
 alt="<?php 
        echo esc_attr($title);
        ?>
">
        </a>
    <?php 
    }
    ?>

    <?php 
    // Start php code
    return ob_get_clean();
}
Example #2
0
                                <div class="col-xs-12">
                                    <div class="row">
                                        <div class="col-xs-12">
                                            <div class="img-block">
                                                <a class="fancybox" rel="group<?php 
            echo $post->ID;
            ?>
" href="<?php 
            echo esc_url($photo['url']);
            ?>
" title="<?php 
            echo esc_attr(get_the_title());
            ?>
">
                                                    <img class="<?php 
            echo outdoor_retina_class();
            ?>
" src="<?php 
            echo esc_url($photo['url']);
            ?>
" width="780" height="380" alt="<?php 
            echo esc_attr(get_the_title());
            ?>
">
                                                </a>
                                            </div>
                                            <div class="clearfix"></div>
                                        </div>
                                    </div>
                                </div>
                            <?php