• Skip to main content
  • Skip to forum navigation

StudioPress

  • Shop for Themes
  • My StudioPress

Forum navigation

  • Home
  • General Genesis Discussions
  • StudioPress Themes
  • Genesis Blocks
    • Genesis Blocks
    • Genesis Custom Blocks
  • Retired Themes
  • FAQs
  • Forum Rules
  • Internationalization and Translations
  • Forum Bugs and Suggestions
  • Forum Log In

Are You Using The WordPress Block Editor?

Genesis now offers plugins that help you build better sites faster with the WordPress block editor (Gutenberg). Try the feature-rich free versions of each plugin for yourself!

Genesis Blocks Genesis Custom Blocks

How do you display CPT Archive page on another post or page?

Welcome!

These forums are for general discussion on WordPress and Genesis. Official support for StudioPress themes is offered exclusively at My StudioPress. Responses in this forum are not guaranteed. Please note that this forum will require a new username, separate from the one used for My.StudioPress.

Log In
Register Lost Password

Community Forums › Forums › Archived Forums › General Discussion › How do you display CPT Archive page on another post or page?

This topic is: not resolved
  • This topic has 4 replies, 2 voices, and was last updated 11 years, 4 months ago by Brad Dalton.
Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • December 17, 2014 at 6:33 am #134740
    PFX
    Member

    Hi - I have been trying to work out how to add/display the custom post type archive page at the bottom of a post and I managed to get this working by following this forum

    http://stackoverflow.com/questions/15214749/how-do-i-display-a-custom-archive-page-under-a-custom-post-in-wordpress

    which results in providing this code, which does the job

    <?php query_posts('post_type=portfolio'); # Use WP_Query arguments accordingly
    get_template_part('archive-portfolio');
    wp_reset_query();
    ?>

    However, the only problem with this is that it breaks the layout of my post - I have the footer outside the wrapper to go full-width, but as soon as I include this archive page, it breaks this 'full-width' of the footer area. I know it is something to do with how things are looping on a page - but I can't see how I can correct this?

    I am placing this code inside a Custom Hook Box to display at the end of the content on a custom post using CPTs.

    Can anyone hint at where I may be going wrong? I have tried to read up on the wordpress codex threads but I am not confident in writing PHP code - so it helps to use snippets as above that do the job, but then figure out how to tweak it to fix in my theme?

    Thanks

    December 17, 2014 at 6:38 am #134742
    PFX
    Member

    I should state that I can't show the web page of what I am trying to do because its not live, but an example of what I am trying to achieve is similar to this website:

    http://www.scorchlondon.com/portfolio/motion-graphics-reel/

    The portfolio archive page links to the post, and then at the bottom of the post the portfolio archive is displayed - which encourages the viewer to click to watch more videos. So I am trying to do the same - put the portfolio archive at the bottom of the post which I can do , but it breaks my footer layout from being full-width across the page and insteads forces it to only spread across the main content width - so something is effecting this.

    Do I need to add code to the actual archive template page OR do I need to adjust the code I have placed in my Custom Hook Box which is displaying the archive template page?

    thanks

    December 17, 2014 at 8:49 am #134750
    Brad Dalton
    Participant

    Firstly, never use query_posts.

    I would hook in the genesis featured posts widget ( modified to display portfolio posts ) after the content.


    Tutorials for StudioPress Themes.

    December 17, 2014 at 9:22 am #134753
    PFX
    Member

    Thanks Brad.

    Yes I have tried the Featured Posts and Pages widgets before I found this code. The widgets are ok, but then you lose the 'filterable' functionality of the archive page. It would be helpful to be able to place the archive page on a post or page elsewhere because it pulls in the styling and functionality ....

    Is there a way of just adjusting the code to work within the Genesis Exec Pro theme without breaking the layout - obviously there is because this other company has done it, and I am just trying to figure out how it has been done so I can adopt a similar approach.

    I find using the Custom Hook Boxes are great for placing content where you want on a page/post, so it would be useful to find a code snippet that would allow me to do this without breaking the layout of the site.

    Is there a reason why we shouldn't use query_posts?

    Thanks for your help!

    December 20, 2014 at 5:39 am #134953
    Brad Dalton
    Participant

    Because its highly inefficient.

    Here's 2 solutions which work


    Tutorials for StudioPress Themes.

  • Author
    Posts
Viewing 5 posts - 1 through 5 (of 5 total)
  • The forum ‘General Discussion’ is closed to new topics and replies.

CTA

Ready to get started? Create a site or shop for themes.

Create a site with WP EngineShop for Themes

Footer

StudioPress

© 2026 WPEngine, Inc.

Products
  • Create a Site with WP Engine
  • Shop for Themes
  • Theme Features
  • Get Started
  • Showcase
Company
  • Brand Assets
  • Terms of Service
  • Accptable Usse Policy
  • Privacy Policy
  • Refund Policy
  • Contact Us
Community
  • Find Developers
  • Forums
  • Facebook Group
  • #GenesisWP
  • Showcase
Resources
  • StudioPress Blog
  • Help & Documentation
  • FAQs
  • Code Snippets
  • Affiliates
Connect
  • StudioPress Live
  • StudioPress FM
  • Facebook
  • Twitter
  • Dribbble