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?
- Custom Post Type Archives by Year & Month?
- Get custom post type slug for an archive page
- Custom Post Type Settings page, choose page to display archive
- Adding custom post type archives to a WordPress menu
- Custom Post Type Template – Archive
- How do you create an archive for a custom post type from a plugin?
- Custom Post Type Archives by Date with Custom Permalink
- How to List All Custom Post Types Names (Not Posts)
- Change title in head on Archive page
- What are the advantages of using a custom post type archive?
- Custom Post Type archive as front page
- Adding Sticky functionality to Custom Post Type Archives
- Adding custom post types to archive.php
- archive-{$post_type}.php not loading. instead the default archive.php loads
- How to make an archive page displaying posts in a date range
- Categories and Tags not working!
- IF statement in a do_shortcode
- WordPress custom post type archive with description
- Strip shortcode from specific post types (formats)
- Pagination in a Shortcode. Get_next_posts_link not working but get_previous_posts_link works fine right next to it
- Display Next/Prev when looping Custom post-types archive?
- Archive page for custom post type not working
- Editable content on a Custom Archive page
- Is it possible to create a shortcode that will query a post based on taxonomies?
- How can I filter by taxonomy on a custom post type’s page?
- An empty Custom Post Type Archive page returns 404 in WP 3.1
- Custom Post Type Loop within Shortcode
- How to display Custom Post Type Post based on Tag with Shortcode Parameter?
- CPT Archive with core Category
- How to create shortcode to display custom field value on a custom post type
- How to enable shortcodes in a custom post type?
- Get custom fields from a custom post type with a shortcode
- get the custom post type title/name
- Custom post types and tag archive pages/permalink structure issue
- Displaying Page as Custom Post type landing Page
- Get custom post type list for every category shortcode
- WordPress post_where & posts_join not working only for custom post type
- CPT archive admin menu label
- Content Editable CPT Archive?
- Shortcode for CPT post content in a page
- Paginate_links in custom post type template
- How to retrieve category of a post in have_post loop?
- How to hyperlink content from archive page with custom post-type
- Excluding a Custom Post Type with a specific tag using pre_get_posts
- sort CPT on Custom Taxonomy Archive page
- Filter content in shortcode
- Shortcode with WP_Query more than once on one page
- CPT Archive pre_get_posts not working?
- Shortcode / WP_Query in post changes context
- add_action ‘init’ from inside a class for custom post types
- Modify a plugin function output from another plugin
- Problems making shortcode with custom post types and taxonomy
- Using Custom Post Meta Values in Shortcode
- Custom post type archive – error in nav-menu-template.php
- Make Next and Previous on single-$posttype.php use the same order as archive-$posttype.php
- CPT archive page – show one post from each taxonomy term
- Get single posts archive information
- Content in WP Editor displayed below CPT shortcode [duplicate]
- Custom Post Type Date Based Archive URL rewrite [duplicate]
- How to make post templates to include shortcodes only?
- Invalid content when I try to import custom post type from the old template wordpress
- How to show Custom Post Type – Case Study using Shortcode & ACF
- Does this archive template part look like its making too many calls to the db?
- Display CPT Category List as Shortcode
- Shortcode with loop stacks output
- Finding the CPT archive template source
- Displaying all posts by category and showing content on click
- WordPress shortcode to pull product post data
- Custom Post type page content (archive page)
- Posts per Page on custom Taxonomy Template
- How to generate auto shortcode for custom post type same as Elementor Template?
- Group custom post type posts by month
- Creating an archive page or simple template to list all values of a custom field of specific post type listing
- Shortcode and get_template_part
- Tell wordpress to show a single page instead of an archive page
- Custom post pagination not working
- Custom post type post_type_link gives “page not found” on any other custom post type
- Enable shortcodes on custom post type
- Custom meta box in editor of custom post type not working
- Custom Post Type shows pagination (w/404) or posts_per_page query, but not both
- How do I make my archive page look like popular reviewing sites (e.g., Polygon and Gamespot) [closed]
- Rewriting archive page slug to be different than custom post type slug
- Plugin Error on activating
- Site loads very slow for archive custom post type page
- shortcode order for event custom post type
- Shortcode display CPT Query only showing 1 post?
- Remove the “View” Link in Post edit Admin
- Have two (permalinks) urls for a same custom post type
- How to display the FAQ Archive page in my menu
- Using get_terms() as shortcode attribute
- How can I set up the URL for a category archive for a custom post type?
- Taxonomy Query of Custom Post Displays Archive Instead of Posts
- Create a Page Templete to Display Table Of Content for Custom Taxonomies
- How to Create Short Code Using Custom Post type
- Custom Post Types using wrong template (index) instead of archive-{type}.php – previously worked as expected
- 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
- Best practice to display a list/archive of Custom Posts in a Page Template
- Archive pagination – second page shows exactly the same posts