• Why the following code put in index.php doesn’t parse shortcodes?

    $page_id = 1;
    $page_data = get_page( $page_id );
    $content = $page_data->post_content;
    $title = $page_data->post_title;
    echo $page_data->post_content;

    How to make it parse shortcodes?

Viewing 1 replies (of 1 total)
  • I’m not sure, but I think do_shortcode() is called by the_content(). You could call it with somethin like this: do_shortcode($content);that returns the $content with the parsed content.

Viewing 1 replies (of 1 total)

The topic ‘Why WP doesn’t parse shortcodes?’ is closed to new replies.