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.
This is correct behaviour. A simple
echo
will just return the field from the DB, unmodified.if you want to render the shortcode try