• Resolved bsmoakwebdev

    (@bsmoakwebdev)


    When I use the shortcode in a post, then call that post via get_post($post_id); inside my front-page.php, the tabs do not display, simply all the text including the shortcodes.

    When I view that post as a single post (single.php), they work fine.

    Any ideas? I am developing locally, so I don’t think I can share the code, sorry.

    Thanks!

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author cubecolour

    (@numeeja)

    get_post($post_id) doesn’t parse shortcodes.

    Executing the do_shortcode() function on the output should enable the shortcodes to be executed.

    eg:

    
    $post_id = 99;
    $queried_post = get_post($post_id);
    echo wpautop(do_shortcode($queried_post->post_content));
    
    Thread Starter bsmoakwebdev

    (@bsmoakwebdev)

    That did it, thank you so much and thanks for the quick reply!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘tabs not displaying when post is called inside page’ is closed to new replies.