Контактная форма 7 петля после [закрыта]
Я использую контактную форму 7. В нем говорится, чтобы использовать следующее
[contact-form-7 id="23" title="Contact form 1"]
В своем посте или на странице я разместил его в своем посте. Теперь я использую этот код, чтобы захватить сообщение и выплюнуть его на своем custom-page.php файл. Однако он просто выплевывает название страницы с датой, а содержимое "размещено" в какой-либо форме, которую нельзя увидеть. Кроме того, как лучше всего разместить контактную форму на странице и иметь возможность перемещать ее с помощью css и тому подобного с помощью контактной формы 7.
<!-- Start the Loop. -->
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
<!-- Display the Title as a link to the Post's permalink. -->
<h2><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2>
<!-- Display the date (November 16th, 2009 format) and a link to other posts by this posts author. -->
<small><?php the_time('F jS, Y') ?> by <?php the_author_posts_link() ?></small>
<!-- Display the Post's Content in a div box. -->
<div class="entry">
<?php the_content(); ?>
</div>
<!-- Stop The Loop (but note the "else:" - see next line). -->
<?php endwhile; else: ?>
<!-- The very first "if" tested to see if there were any Posts to -->
<!-- display. This "else" part tells what do if there weren't any. -->
<p>Sorry, no posts matched your criteria.</p>
<!-- REALLY stop The Loop. -->
<?php endif; ?>
1
Author: Anders Kitson, 2012-01-25
1 answers
Вы всегда можете сделать что-то вроде этого:
echo do_shortcode( '[contact-form-7 id="23" title="Contact form 1"]' );
И поместите это в любом месте вашей темы, чтобы отобразить его.
Документы: do_shortcode
3
Author: Jared, 2012-01-25 22:55:33