Пример #1
0
    cws_post_output($sb_block, 'large', '2', $post);
    cws_page_links();
    ?>
									</div>
									<?php 
}
?>
						</section>
					</div>
				</div>
				<?php 
if ($post_type == "portfolio") {
    $cws_stored_meta = $cws_stored_meta[0];
    if (isset($cws_stored_meta["cws-portfolio-use_rel_projects"])) {
        $title = isset($cws_stored_meta["cws-portfolio-rel_projects_title"]) ? $cws_stored_meta["cws-portfolio-rel_projects_title"] : "";
        $postspp = isset($cws_stored_meta["cws-portfolio-rel_projects_num"]) ? $cws_stored_meta["cws-portfolio-rel_projects_num"] : "";
        echo "<div class='grid-row'>";
        echo "<section class='photo_tour_section cws_widget'>";
        echo render_portfolio_carousel($postspp, $title);
        echo "</section>";
        echo "</div>";
    }
}
comments_template();
?>
			</main>
		</div>
	</div>

<?php 
get_footer();
Пример #2
0
function shortcode_cws_portfolio($attr = array())
{
    extract(shortcode_atts(array('cols' => '2', 'cats' => '', 'usefilter' => '', 'filter' => '', 'usecarousel' => '', 'carousel' => '', 'title' => '', 'postspp' => '', 'items' => ''), $attr));
    require_once THEME_DIR . '/core/portfolio-cols.php';
    $usecarousel = !empty($usecarousel) ? $usecarousel : $carousel;
    $usefilter = !empty($usefilter) ? $usefilter : $filter;
    $postspp = !empty($postspp) ? $postspp : $items;
    wp_enqueue_script('cws-script-portfolio-js', THEME_URI . '/core/js/portfolio.js', array('jquery'));
    $content = "<section class='photo_tour_section cws_widget'>";
    if ($usecarousel == '1') {
        $content .= render_portfolio_carousel($postspp, $title, $cats);
    } else {
        $blogtype = in_array($cols, array('2', '3', '4')) ? 'pinterest' : 'large';
        $pid = get_the_ID();
        $pid = !empty($pid) ? $pid : (isset($post) ? $post->ID : get_query_var("page_id"));
        $content .= render_portfolio($cols, $cats, '1' === $usefilter, $postspp, 1, $cats, false, $blogtype, $title, $pid);
    }
    $content .= '</section>';
    return $content;
}