I am trying to add a contact from 7 shortcode into a custom post type, I can add it using 'the_content'
filter but the problem is that it will be added to all post types which is not right.
How can i hook into a custom post type only without messing with other post types?
You can add code in PHP also for displaying shortcode, url
// Use shortcodes in form like Landing Page Template.
echo do_shortcode( '[contact-form-7 id="91" title="quote"]' );
Or you can directly add into the content in wp Editor of your custom post type, in which post you want to show the shortcode. So it will be shown for that post only in single.php .
Hope this will helps you.
single-{custom-post-type}.php
Hope this helps.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.