If someone needs something similar, I actually found an answer to my issue and it is to pass arguments to get_header()
and get_footer()
.
<?php
get_header('customposttype);
?>
<div style="width:500px;">
<?php
$id = get_the_id();
echo do_shortcode( '[skwidget id="' . $id . '"]' );
?>
</div>
<?php get_footer('customposttype'); ?>
and copy header.php
to header-{customposttype}.php
and footer.php
to footer-{customposttype}.php
And after that custom modifiy the
header-{customposttype}.php
footer-{customposttype}.php
after your needs!
Related Posts:
- Can I assign a template to a custom post type?
- Searching multiple custom post types and pages
- Taxonomy, Terms, and Template Files
- tag.php doesn’t work with tags on a custom post type post?
- Assign single template to multiple custom post types?
- Add Content to Page without shortcodes
- Using Templates with Custom Post Type UI
- Get page by template?
- Custom taxonomy query for a custom post type
- Custom Post Type Archive URL takes over page URL
- Custom Post Type Archive Template
- Custom templates for posts like for pages: page-{id} vs single-{id}
- Posts in Multiple Columns and Rows with one single loop
- How do I create new content pages for my Custom Post Type?
- Display different gutenberg template from selected post attributes
- Clean URL permalink for custom post type
- where can I see my custom post type archive template?
- Display posts of child category in template
- custom taxonomy – Template not working
- Create separate template for shared custom taxonomy with shared terms
- Trying to manage templates on a blog with lots of custom taxonomies
- wordpress 3.4 template files in subdirectories
- How do I provide a “show all posts” link in a paginated term archive?
- I am trying to output portfolio items with a picture. This code doesn’t seem to be working. What am I doing wrong?
- Help with CPT template pagination
- How can I force custom post type to use a specific template?
- Merge multiple custom post types in a single archive template
- Trying to edit the single page from a Custom Post
- Plugin templates in which directory
- Using wordpress template tags within an array
- Include custom post type single template, but respect theme override of template if it exists
- Custom template page with custom archives listing by user
- Custom Post Type template stored in plugin folder not showing in post attributes dropdown
- How to clone the “Projects” Custom Post type in Divi theme
- Create template for taxonomy results limited by Custom Post Type
- Custom post type content using custom fields without template
- 2 Templates 1 custom post type according url
- How to use custom template files in deeper directory?
- Migrating a taxonomy’s tags to the native category
- How can I get this request to use the Custom Post Type page template instead?
- Archive for a Taxonomy of a Custom Post type
- Set templates for custom post types
- Main query not querying any posts in custom taxonomy template
- Custom posts template page
- How can I use archive-{post_type}.php theme template?
- Add Previous/Next Buttons to CPT Single Pages Only
- Which file/template is in charge of taxonomies for custom post types?
- How do I assign a block template (.html) to a custom post type?
- Templates for hierarchical custom post type
- Custom Post Type setup
- Apply template by path/slug related to custom post type?
- How to get the current category with custom posts
- Custom Post Type homepage template
- WP not recognizing custom post type / template
- Archive Template being used instead of Category Template for Custom Post Type
- Create a custom taxonomy template that loops through child categories in term order?
- Display Posts Query with IF function
- My template won’t apply, theme still fallback to index.php
- Set generic reservation form for custom post type
- One Custom Post Type two different Templates
- How can I allow users to edit text that will be displayed on a custom post type archive page?
- handling templates and widgets for custom content types
- On click some element i want to use some template
- Post template with breadcrumb needs to show page navigated from
- Add custom template ‘sub-page’ to Custom Post type?
- Load info from customposttype into template page
- custom post template design with dropdown option
- Accessing download link from the loop with WP Download Manager Pro
- Custom post type single page uses the right template in preview mode but shows a different template after being posted
- Warning , Use of undefined constant PLUGIN_PATH?
- Post Attribute Section missing for Custom post type
- How to assign post to category
- Custom taxonomy with custom post type template not showing
- Custom taxonomy template for custom fields loop [closed]
- WordPress Custom Post Type – Post Attribute: Template. Template shows up and saves on the back end, but the default theme file is being rendered
- Single taxonomy for different custom post types
- Values show up in custom home page but not in custom post pages
- How should i name the .php file to show custom posts under a taxonomy’s term?
- Organising custom taxonomies and custom post types
- Include template if a post is a single product
- Custom post type with two templates
- Custom Post Type tag taxonomy “Page Not Found”
- DIVs not showing correctly on CPT?
- How to decouple custom post types components from template?
- Show Templates in Custom Post Type Editor
- template structure for CPT not clear
- Parent to another Custom Post Type – Template files not being recognized
- How to avoid hardcoded text in a custom page template?
- Load different template for CPT (in loop) in my plugin?
- Having some trouble properly displaying Custom Post Types in templates
- query_post while (have post) get_template_part()?
- Using custom post types within a section of a template
- Listing all custom post types using a specific term on the said term’s template page, in groups
- Problem retrieving custom field for a custom post type
- Only One Post of Custom Post Type Appearing on Template Page
- CPT Template Option to Top
- How to create custom page templates with default page layout framework?
- Choose custom post type template by category
- using a template for more then 1 page
- How can I produce multiple webpages with a different output based on one entry/Page/custom Page?