Contact Form 7
[resolved] Special mail tags doesn't work in custom post types (5 posts)

  1. nicozz
    Posted 2 years ago #


    I use Contact Form 7 on pages and post and it work perfectly with special mail tags as [_post_title]
    But if I put the same form on a custom post page, it doesn't send me the post title, but [_post_title] instead.

    How can I solve that?

    Thank you for your help.


  2. Takayuki Miyoshi
    Plugin Author

    Posted 2 years ago #

    It should work. How have you made the custom post type page?

  3. nicozz
    Posted 2 years ago #

    Hi Takayuki,

    Thank you for your answer.

    Yes, I've created custom port type's pages.
    I've tried including the form in the template and in the_content().
    But in both cases, when I want to receive the post title in the mail, I just receive [_post_title].
    The other part of the message are ok but not the special mail tag.

    I've also tried in post or pages and it works correctly.

    I don't know why.

  4. canetwp
    Posted 2 years ago #

    this happens for me too, does anybody know why?
    posts and pages work fine but custom post types get just [_post_title] back.

    my code is:
    <?php if ( is_user_logged_in() ) {
    echo do_shortcode( '[contact-form-7 id="146" title="italiano"]' );

    and CPT is mada using TYPES

    Thanks for the help, ciao


  5. canetwp
    Posted 2 years ago #


    do_shortcode has to be within the loop!

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Contact Form 7
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic