Support » Plugin: Contact Form 7 » Special mail tags doesn't work in custom post types

  • Resolved nicozz

    (@nicozz)


    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/

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Takayuki Miyoshi

    (@takayukister)

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

    nicozz

    (@nicozz)

    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.

    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

    SOLVED:

    do_shortcode has to be within the loop!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Special mail tags doesn't work in custom post types’ is closed to new replies.