wordpress not displaying my form

When I create a page with the content as [contact-form-7 id="199" title="Untitled"] , it displays the form,
but when I use it as

<div class="first"><?php $recentProjects = get_post('275'); echo $recentProjects->post_content; ?> </div>

it is not working. It is displaying [contact-form-7 id="199" title="Untitled"] instead of form.

Related posts

Leave a Reply

1 comment

  1. This is correct behaviour. A simple echo will just return the field from the DB, unmodified.

    if you want to render the shortcode try

    <div class="first"><?php $recentProjects = get_post('275'); echo do_shortcode($recentProjects->post_content); ?> </div>