WordPress.org

Ready to get started?Download WordPress

Forums

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

  1. nicozz
    Member
    Posted 1 year ago #

    Hi,

    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.
    Nick.

    http://wordpress.org/extend/plugins/contact-form-7/

  2. Takayuki Miyoshi
    Member
    Plugin Author

    Posted 1 year ago #

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

  3. nicozz
    Member
    Posted 1 year 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
    Member
    Posted 8 months 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

    Alessandro

  5. canetwp
    Member
    Posted 8 months ago #

    SOLVED:

    do_shortcode has to be within the loop!

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic