How do I add a slider short code under the header?

Viewed 46

<?php echo do_shortcode('[metaslider id="1149"]'); ?>

<?php /* Template Name: Home */
get_header();
    $page_id = $post_id_main = $post->ID;
    $wp_page_template = discy_post_meta("_wp_page_template",$post_id_main,false);
    include locate_template("theme-parts/tabs.php");
get_footer();?> 

How can I add the above slider shortcode under the header just on the home page?

I had tried several times but still had this error:

syntax error, unexpected '<', expecting end of file

1 Answers

Try the below code.

<?php /* Template Name: Home */
get_header();
    echo do_shortcode('[metaslider id="1149"]');
    $page_id = $post_id_main = $post->ID;
    $wp_page_template = kemlat_post_meta("_wp_page_template",$post_id_main,false);
    include locate_template("theme-parts/tabs.php");
get_footer(); ?> 
Related