<?php

function gfxbucket_portfolio_featured_func( $atts, $content ) {
	wp_enqueue_script( 'slick', plugins_url( 'javascript/slick.min.js', __FILE__ ), array('jquery'), '', true );
	
	return '<div class="projects">' . do_shortcode($content) . '</div>';
}
add_shortcode( 'portfolio_featured', 'gfxbucket_portfolio_featured_func' );

function gfxbucket_portfolio_featured_item_func( $atts, $content ) {
	extract(shortcode_atts( array(
		'image'      => '',
        'url' 	     => '#',
        'text_left'  => '',
        'text_right' => '',
        'title'      => ''
	), $atts ));

	$return = '<div style="background-image: url(\'' . $image . '\'); background-position: top;"><div class="container">';

	if( $text_right == '' ) {
		$return .= '<div class="row"><div class="col-md-6"><h2 class="title">' . do_shortcode($title) . '</h2>';
		$return .= '<p>' . $text_left . '</p><a href="' . $url . '" class="btn btn-md">' . __( 'View Project', 'gfxbucket-shortcodes' ) . '</a></div></div>';
	} else {
		$return .= '<div class="row"><div class="col-md-12"><h2 class="title">' . do_shortcode($title) . '</h2></div></div>';
		$return .= '<div class="row"><div class="col-md-6"><p>' . $text_left . '</p><a href="' . $url . '" class="btn btn-md">' . __( 'View Project', 'gfxbucket-shortcodes' ) . '</a></div>';
		$return .= '<div class="col-md-6"><p>' . $text_right . '</p></div></div>';
	}

	$return .= '</div></div>';

	return $return;
}
add_shortcode( 'portfolio_featured_item', 'gfxbucket_portfolio_featured_item_func' );