Esempio n. 1
0
function ompf_portfolio_ajax()
{
    $out = array('error' => 0);
    $args = array();
    if (isset($_POST['portfolio_id']) && $_POST['portfolio_id']) {
        $args['portfolio_post_id'] = $_POST['portfolio_id'];
    } else {
        $out['error'] = 1;
        wp_send_json($out);
    }
    if (isset($_POST['category_id']) && $_POST['category_id']) {
        $args['category_id'] = $_POST['category_id'];
    }
    if (isset($_POST['paged']) && ($paged = intval($_POST['paged']))) {
        $args['query_args']['paged'] = $paged;
    }
    $portfolio = ompf_get_portfolio_thumbnails($args);
    $out['html'] = $portfolio['html'];
    if ($portfolio['pagination'] == 'pages') {
        $out['html_pagination'] = ompf_pagination_links($portfolio['paged'], $portfolio['max_num_pages'], array('empty_href' => true));
    } elseif ($portfolio['pagination'] == 'scroll') {
        $out['html_pagination'] = ompf_loadmore_link($portfolio['paged'], $portfolio['max_num_pages'], array('empty_href' => true));
    } else {
        $out['html_pagination'] = '';
    }
    wp_send_json($out);
}
Esempio n. 2
0
function ompf_portfolio_archive_page($settings_page_page_id = false)
{
    global $wp_query;
    $args = array('portfolio_post_id' => $settings_page_page_id, 'wp_query' => $wp_query);
    $portfolio = ompf_get_portfolio_thumbnails($args);
    /**
     * Portfolio content
     */
    $uberwrapper_classes = array('ompf-portfolio-wrapper');
    $uberwrapper_classes = apply_filters('ompf_portfolio_wrapper_classes', $uberwrapper_classes);
    $wrapper_classes = array('ompf-portfolio');
    $wrapper_classes[] = 'ompf-layout-' . $portfolio['args']['layout'];
    $wrapper_classes[] = 'ompf-size-' . $portfolio['args']['size'];
    $wrapper_classes[] = 'ompf-margins-' . $portfolio['args']['margins'];
    $wrapper_classes[] = 'ompf-pagination-' . $portfolio['pagination'];
    if ($portfolio['pagination'] != 'pages') {
        $wrapper_classes[] = 'ompf-isotope';
    }
    $wrapper_classes[] = 'ompf-preview-layout-' . $portfolio['args']['preview_layout'];
    $wrapper_classes = apply_filters('ompf_portfolio_classes', $wrapper_classes);
    $tmp = '
	<div class="' . implode(' ', $uberwrapper_classes) . '">
		<div class="' . implode(' ', $wrapper_classes) . '" id="ompf-portfolio"' . ($GLOBALS['omPortfolioPlugin']['config']['fit_thumbnails_height'] ? ' data-fit-height="true"' : '') . ' data-portfolio-post-id="' . $settings_page_page_id . '">
	';
    $tmp = apply_filters('ompf_portfolio_header', $tmp);
    echo $tmp;
    echo $portfolio['html'];
    $tmp = '
		</div>	
	</div>
	';
    $tmp = apply_filters('ompf_portfolio_footer', $tmp);
    echo $tmp;
    echo '<div id="ompf-pagination-holder">';
    echo ompf_pagination_links($portfolio['paged'], $portfolio['max_num_pages']);
    echo '</div>';
}
Esempio n. 3
0
$wrapper_classes[] = 'ompf-layout-' . $portfolio['args']['layout'];
$wrapper_classes[] = 'ompf-size-' . $portfolio['args']['size'];
$wrapper_classes[] = 'ompf-margins-' . $portfolio['args']['margins'];
$wrapper_classes[] = 'ompf-pagination-' . $portfolio['pagination'];
if ($portfolio['pagination'] != 'pages') {
    $wrapper_classes[] = 'ompf-isotope';
}
$wrapper_classes[] = 'ompf-preview-layout-' . $portfolio['args']['preview_layout'];
$wrapper_classes = apply_filters('ompf_portfolio_classes', $wrapper_classes);
$tmp = '
	<div class="' . implode(' ', $uberwrapper_classes) . '">
		<div class="' . implode(' ', $wrapper_classes) . '" id="ompf-portfolio"' . ($GLOBALS['omPortfolioPlugin']['config']['fit_thumbnails_height'] ? ' data-fit-height="true"' : '') . ' data-portfolio-post-id="' . $portfolio_post_id . '" data-portfolio-category-id="' . ($portfolio_category ? $portfolio_category : '') . '">
	';
$tmp = apply_filters('ompf_portfolio_header', $tmp);
echo $tmp;
echo $portfolio['html'];
$tmp = '
		</div>	
	</div>
	';
$tmp = apply_filters('ompf_portfolio_footer', $tmp);
echo $tmp;
if ($portfolio['pagination'] == 'pages') {
    echo '<div id="ompf-pagination-holder">';
    echo ompf_pagination_links($portfolio['paged'], $portfolio['max_num_pages']);
    echo '</div>';
} elseif ($portfolio['pagination'] == 'scroll') {
    echo '<div class="ompf-loadmore-holder" id="ompf-loadmore-holder">';
    echo ompf_loadmore_link($portfolio['paged'], $portfolio['max_num_pages']);
    echo '</div>';
}