I'm looking to insert a function which is otherwise denoted as a WP shortcode. The page is failing to display entirely when this code is inserted. Here is the full code which comprises the shortcode:
function vntd_blog_carousel($atts, $content = null) {
extract(shortcode_atts(array(
"cats" => '',
"posts_nr" => '',
"thumb_style" => ''
), $atts));
wp_enqueue_script('prettyPhoto', '', '', '', true);
wp_enqueue_style('prettyPhoto');
wp_enqueue_script('owl-carousel', '', '', '', true);
wp_enqueue_style('owl-carousel');
ob_start();
echo '<div class="vntd-portfolio-carousel blog-carousel"><div class="works white">';
$size = 'portfolio-square';
wp_reset_postdata();
$args = array(
'posts_per_page' => 6,
'cat' => 4,
'orderby' => 'slug'
);
$the_query = new WP_Query($args);
if ($the_query->have_posts()) : while ($the_query->have_posts()) : $the_query->the_post();
I would normally use the shortcode, but I am placing this directly in the PHP page file. The output is failing to display on the page however, and the page fails to load with this code. I am assuming this is because there is an error with one of the parameters that I have manually filled in.