1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42: 43: 44: 45: 46: 47: 48: 49: 50: 51: 52: 53: 54: 55: 56: 57: 58: 59: 60: 61: 62: 63: 64: 65: 66: 67: 68: 69: 70: 71: 72: 73: 74: 75: 76: 77: 78: 79: 80: 81: 82: 83: 84: 85: 86: 87: 88: 89: 90: 91: 92: 93: 94: 95: 96: 97: 98: 99: 100: 101: 102: 103: 104: 105: 106: 107: 108: 109: 110: 111: 112: 113: 114: 115: 116: 117: 118: 119: 120: 121: 122: 123: 124: 125: 126: 127: 128: 129: 130: 131: 132: 133: 134: 135: 136: 137:
<?php
$shortcodes_config['landing-page-list'] = array(
'no_preview' => true,
'options' => array(
'heading' => array(
'name' => __('Heading Text', 'inbound-pro' ),
'desc' => __('Enter the heading text.', 'inbound-pro' ),
'type' => 'text',
'std' => 'Recent Content Offers'
),
'column' => array(
'name' => __('Column', 'inbound-pro' ),
'desc' => __('Select the number of column(s).', 'inbound-pro' ),
'type' => 'select',
'options' => array(
'2' => __('2 Columns', 'inbound-pro' ),
'3' => __('3 Columns', 'inbound-pro' ),
'4' => __('4 Columns', 'inbound-pro' )
),
'std' => '4'
),
'number' => array(
'name' => __('Post Number', 'inbound-pro' ),
'desc' => __('Enter the number of post to show.', 'inbound-pro' ),
'type' => 'text',
'std' => '4'
)
),
'shortcode' => '[landing-page-list heading="{{heading}}" column="{{column}}" number="{{number}}"]',
'popup_title' => 'Insert Landing Page List Shortcode'
);
$freshbuilder_modules['landing-page-list'] = array(
'name' => __('Portfolio', 'inbound-pro' ),
'size' => 'one_full',
'options' => array(
'heading' => array(
'name' => __('Heading', 'inbound-pro' ),
'desc' => __('Enter the heading text.', 'inbound-pro' ),
'type' => 'text',
'std' => 'Recent Project',
'class' => '',
'is_content' => 0
),
'column' => array(
'name' => __('Column', 'inbound-pro' ),
'desc' => __('Select the number of column(s).', 'inbound-pro' ),
'type' => 'select',
'options' => array(
'2' => __('2 Columns', 'inbound-pro' ),
'3' => __('3 Columns', 'inbound-pro' ),
'4' => __('4 Columns', 'inbound-pro' )
),
'std' => '4',
'class' => '',
'is_content' => 0
),
'number' => array(
'name' => __('Post Number', 'inbound-pro' ),
'desc' => __('Enter the number of post to show.', 'inbound-pro' ),
'type' => 'text',
'std' => '4',
'class' => '',
'is_content' => 0
)
)
);
add_shortcode('landing-page-list', 'inbound_shortcode_portfolio');
if (!function_exists('inbound_shortcode_portfolio')) {
function inbound_shortcode_portfolio( $atts, $content = null ) {
extract(shortcode_atts(array(
'heading' => 'Recent Project',
'column' => 4,
'number' => 4
), $atts));
global $post;
$grid = ' grid one-half';
if ($column == '3') $grid = ' grid one-third';
if ($column == '4') $grid = ' grid one-fourth';
$out = '';
$i = 0;
$out .= '<div class="portfolio-items row">';
if ($heading != '') $out .= '<div class="grid full"><div class="heading"><h3>'.$heading.'</h3><div class="sep"></div></div></div>';
$number = ($number) ? "&posts_per_page=$number" : '';
$args = "post_type=portfolio$number";
$loop = new WP_Query( $args);
if ( $loop->have_posts() ) :
while ( $loop->have_posts() ) : $loop->the_post(); $i++;
$meta = get_post_meta( $post->ID, 'ft_portfolio_subtitle', true) ? get_post_meta( $post->ID, 'ft_portfolio_subtitle', true) : freshthemes_get_portfolio_categories();
$out .= '<div class="'.$grid.'">';
$out .= '<article class="item clearfix">
<figure class="item-thumb">
'.get_the_post_thumbnail($post->ID, '500x360').'
<div class="overlay">
<a class="view-link" href="'.get_permalink().'" rel="bookmark">'.__('View Project', 'inbound-pro' ) .'</a>
</div>
</figure>
<header class="item-header">
<h4 class="item-title"><a class="reserve" href="'.get_permalink().'" title="" rel="bookmark">'.get_the_title().'</a></h4>
<div class="item-meta">'. $meta .'</div>
</header>';
$out .= '</article>';
$out .= '</div>';
if( $i == $column ) $out .= '<div class="clear"></div>';
endwhile;
endif;
wp_reset_postdata();
$out .= '</div>';
return $out;
}
}