Most probably you need a bunch of divs etc duplicated in both archive-custom.php
and the shortcode. Identify those divs, and move them into a new template file in your theme, e.g. in part-archive-custom.php
.
Then, delete them from archive-custom.php
and add a call to get_template_part('part-archive-custom');
instead.
Do the same inside your shortcode.
Related Posts:
- Where to put my code: plugin or functions.php?
- How to remove custom post type archive
- How to use a custom post type archive as front page?
- Custom Post Type Archives by Year & Month?
- Get custom post type slug for an archive page
- How do I make my archive page look like popular reviewing sites (e.g., Polygon and Gamespot) [closed]
- Display custom post type archive on page.php template
- Making a archive gallery page for a custom post type which already has an archive page
- Custom taxonomy in custom post type archive with pagination
- why custom post archive gives always no more than 10 posts despite of paging settings?
- Rewriting archive page slug to be different than custom post type slug
- Plugin Error on activating
- Ads below footer
- Shortcode error
- Modify shortcode to work with custom taxonomies and slugs
- Custom Info Box at end of posts?
- Pagination fault in custom post type archive page [duplicate]
- Custom post types archive
- Site loads very slow for archive custom post type page
- shortcode order for event custom post type
- Templates list in “Page Attributes” metabox is inaccurate
- Shortcodes in custom post fields without the_content()
- Shortcode display CPT Query only showing 1 post?
- Stop Custom post type from being searched via URL
- Permalink of custom post type partly broken
- Remove the “View” Link in Post edit Admin
- Custom Post Type Archive Links Not Working
- CPT archive as home page
- Have two (permalinks) urls for a same custom post type
- Custom Post Type vs Shortcode: Which one is more performant?
- Archive page of filtered posts
- How to display the FAQ Archive page in my menu
- Rewrite rules causing hole
- How to call Shortcode categories for custom post types?
- Custom post type category page not working
- Why is this custom post type defaulting to archive.php?
- Using get_terms() as shortcode attribute
- title tag for custom post type remove taxonomy name from title tag
- How can I retrieve the slug for a custom post type via name?
- paging is not working properly on news archives page [duplicate]
- adding a shortcode into a custom post type
- How can I set up the URL for a category archive for a custom post type?
- CPT Archive with parent page
- Nested loop called with shortcode duplicating the content above the main loop
- Add number in increment of one to DIV ID
- shortcode for recent custom type post
- Create shortcode for list of custom post titles with custom fields alongside
- Taxonomy Query of Custom Post Displays Archive Instead of Posts
- Archive Page Pagination not working
- Custom taxonomy archive page not routing?
- single-mySlug.php works: archive-mySlug.php does not. Custom Post Type
- Creating shortcodes with user created forms
- Create a Page Templete to Display Table Of Content for Custom Taxonomies
- has_archive for default post type
- custom post type not getting archived?
- Pagination not working for archive
- How to have a dynamic slug and rendering the archive-{post_type}.php?
- Remove plugin’s custom post type archive page and single pages [closed]
- Navigation links to posts in current term shortcode
- How to Create Short Code Using Custom Post type
- Adding custom shortcode to page leads to page without styling
- custom post types shortode stays on top of other page contents. Is there a bug?
- Rewrite a filter as shortcode (or something like that) to use anywhere in CPT
- Display posts from another page on home page in wp-editor
- Pagination for Custom Post Type with Multiple Types
- Custom Post Type Archive Title Lowercase
- Shortcode in a page to display custom posts which also have a shortcode in them
- How to loop through a custom post type using a shortcode and output each element in the loop using shortcodes
- Passing postid of Testimonial Custom Post in Shortcode Parameter
- Add a class to a menu item depending on a body class
- Custom Post Types using wrong template (index) instead of archive-{type}.php – previously worked as expected
- Pagination not working only on Archive-Name.php using new WP_Query
- Show custom post type on post category page doesn’t work / breaks navigation
- On archive.php show loop for child categories if they exist or posts if they don’t, on custom post type
- Display page and custom post title inside shortcode
- trying to display custom post type with custom taxonomy value by shortcode can’t works [closed]
- Pagination not working on custom post type archive
- Best practice to display a list/archive of Custom Posts in a Page Template
- How to separate posts by categories?
- Archive pagination – second page shows exactly the same posts
- Custom archive URL as a subfolder of the custom post type slug
- Problem with shortcode
- Can’t add custom post type archive page to menu
- Dynamic WordPress rewrite rules for multiple custom post types
- strange issue with get_post_type() when using it in a shortcode in text widget
- WordPress CPT archive page display sticky post first and then display the rest of the posts in same Query
- select categories by ids/display terms only selected
- How to work with URLs where sometimes a post or a subcategory is in the same part of the URL structure
- Custom Field in Page Title
- Show only taxonomy types terms associated with a custom post type in WordPress PHP
- Create side bar widget showing list of years as hyperlinks for a custom post type
- SOLVED: Shortcode to display Divi project filtered by tag in WP Query loop
- Made a Custom Post Type using ACF. Via the dashboard I cannot see the view button to see the post
- Remove date rewrite rule for custom post type archive page
- Add Shortcode functionality to a function that queries custom post type / taxonomy
- Custom Post Type Pagination Showing 404 On archive pages
- Cannot create custom post types with a specific name
- WordPress display post count for custom post type
- Rewrite taxonomy permalink appended to CPT archive url
- Display the progress of post achievement with percentage against target in wordpress dashboard