I solved now, by adding this snippet in functions.php
function my_form_shortcode() {
ob_start();
get_template_part('my_form_template');
return ob_get_clean();
}
add_shortcode( 'my_form_shortcode', 'my_form_shortcode' );
Related Posts:
- Adding PHP/HTML code inside page from custom template
- shortcode javascript not working on custom template file inside theme folder
- WordPress shortcode display as plain text
- Problem with multiple shortcode in page template
- Using shortcodes to communicate my page design
- Enclosing Shortcode not working in a Template
- Shortcode or Template Page
- Push Shortcode parameter to template
- Separating Custom Template logic
- Can not get shortcode content in function
- Shortcode outputs at the top of the_content
- Combining shortcode and get_template_part
- Escaping quotes from shortcode attributes
- Shortcode output always showing at top of page
- How to detect if a Shortcode is being called on a page?
- How to get current page title inside a page itself in a shortcode and in page content
- Short code to display a loop
- shortcode inside another shortcode
- How can I just get content inside a shortcode or just outside
- Need MySQL Query or WP-CLI command to updates old URLs in Shortcodes [closed]
- Custom Shortcode AJAX 400 Bad Request
- WordPress core responsive video not working with shortcode
- shortcode to create dynamic dropdown box form shortcode attributes
- conditional shortcode not working
- Can’t seem to get [shortcode]s to work
- Wraping $content into link with shortcodes
- nested Shortcode doesn’t work
- Simple contact form with field validation
- TinyMCE get selected text and underlying HTML
- Rewriting WordPress Gallery Shortcode with Bootstrap Carousel
- other shortcodes in Contact form 7 MAILS [closed]
- Remove empty p-Tags in Shortcode content before non p-Tags
- What is a short code?
- Change link in get_terms if there is only one post in the category
- Allow shortcode in the author bio textarea
- How do I combine my shortcodes?
- Bulk converting shortcodes to blocks with embeds
- How to add source code into wordpress post really?
- shortcode_atts – one URL variable not working
- Caption shortcodes not including caption as attribute
- Make shortcode’s Bootstrap CSS override the theme’s CSS, how?
- Passing a nested shortcode as an argument of another shortcode?
- Change the default video shortcode
- How to use shortcode in js url
- How to add AJAX in a custom PHP function using Google sheets API
- Nested Code Snippets [closed]
- How do I display “Hello username” if logged-in on the homepage
- Shortcode to show current post category with link
- Gutenberg Block with Select from JSON-File
- How to register a user via modal after clicking a link in the shortcode?
- add widget to page content (using shortcode)
- WordPress TinyMCE : Get value of popup button
- Freeze a shortcode in place?
- Unable to the get the gallery inserted between shortcodes
- How to use/enable Pagination?
- Wrap Shortcodes and wpautop
- Shortcode called twice
- Favorite websites with shortened hyperlinks
- Best way to find all shortcodes that come with WordPress
- Using Variables in Shortcodes
- Add JS in footer via shortcode?
- Shortcode syntax errors
- Passing variable in nested shortcodes
- Shortcode Always Displays Default Attribute Value
- WordPress Shortcode / Only works in classic editor, gutenberg error / invalid json response
- Do shortcode in template file
- How do I fit a function inside an opening and closing do_shortcode
- Pass instance number to shortcode child
- How to make shortcode which returns HTML?
- Add shortcode within the_content()
- How to create a custom shortcode for custom login form?
- Pass a comma separated shortcode attribute to a function
- how to write short code in word press
- hard code shortcode only on specific category
- pass complex json as shortcode parameter
- How to include shortcodes and pdfs in WordPress search without plugin?
- How to embeded shortcode for another website
- Gutenberg Shortcode will turn html to html entity
- Need help in setting up a transient using API Key and if possible updating it in the ACF field
- the_content() not showing the content in good order (with a shortcode)
- Execute shortcode in backend
- How to Enable embedding WordPress default gallery in comments?
- Print shortcode according to site language
- Remove a short code and update it’s content (AJAX)
- create a shortcode for embedding google map in a page
- Timber – don’t display shortcode
- Use ACF array values in shortcode
- php in a shortcode
- Pull in excerpt with shortcode
- WordPress core playlist function not showing artist and album info
- Which method to use when deleting posts from the front-end
- Add an access code form to call a unique page based on page without registration
- short code is not working in in custom wordpress theme it’s only working in default theme
- Display post_meta in Shortcode
- Gallery Shortcode: using size=”full” doesn’t call the actual thumbnail image size
- loop on page makes shortcode fail
- php code to shortcode [duplicate]
- Shortcode leads to white screen [closed]
- How to stop an image link continuing to link adjacent text from a shortcode?
- Show realtime Amazon price without API using shortcode