function bran23_portfolio_source($atts, $content = null)
{
$settings = shortcode_atts(array(
'max' => -1,
'cols' => 4,
'portfolio_id' => -1,
'more_link' => false,
'empty' => false
), $atts);
$query_settings = array(
'post_type' => 'portfolio',
'post_status' => 'publish',
'posts_per_page' => ($settings["portfolio_id"] != -1) ? 3 : $settings["max"],
'post__not_in' => array($settings["portfolio_id"]),
'meta_key' => '_bran23_hide_project',
'meta_compare' => '!=',
'meta_value' => '1',
);
if (!($settings["portfolio_id"] === -1 || $settings["empty"])){
$terms = get_the_terms($settings["portfolio_id"], 'portfolio_category');
if (empty($terms))
$terms = array();
$query_settings = array_merge($query_settings, array(
'orderby' => 'rand',
'tax_query' => array(
array(
'taxonomy' => 'portfolio_category',
'field' => 'slug',
'terms' => wp_list_pluck($terms, 'slug')
)
)
)
);
}
$portfolio_loop = new WP_Query($query_settings);
$output = "";
if (is_front_page())
$output = '
' .__("Naujausi darbai", "bran23"). '
';
$output .= '';
$key = 0;
while ($portfolio_loop->have_posts()){
$portfolio_loop->the_post();
$key++;
$project_guid = GUID();
$project_url = get_the_permalink();
$project_bg = wp_get_attachment_image_url(get_field('_bran23_parallax'), 'large');
$project_bg_fallback = get_field('_bran23_bodybg');
$project_logo = get_field('_bran23_project_logo');
$project_title = get_the_title();
$project_categories = list_portfolio_categories(get_the_ID());
$output .= <<
{$project_title}
{$project_categories}
HTML;
}
wp_reset_query();
$output .= '';
$output .= '';
if (!$settings["empty"] && $portfolio_loop->found_posts == 0){
$output = do_shortcode('[bran23_portfolio portfolio_id="'. $settings["portfolio_id"] . '" empty="true" max="3"]');
}
return $output;
}
add_shortcode('bran23_portfolio', 'bran23_portfolio_source');
?>
agentūra brandù | Efektyvūs sprendimai jūsų prekiniam ženklui
if(have_rows("_bran23_intro_work", "option")):
$key = 1;
while( have_rows('_bran23_intro_work', 'option') ) :
$key++;
the_row();
$type = get_sub_field("_bran23_work_type");
$title = get_sub_field("_bran23_work")->post_title;
?>
endwhile; ?>
endif; ?>
set_query_var('_bran23_max_projects', 6); ?>
get_template_part('parts/portfolio'); ?>
//get_template_part('parts/insights'); ?>
get_template_part('parts/reviews'); ?>
get_footer(); ?>