• Resolved JUROTO

    (@juroto)


    I am working on my WordPress portfolio site and created a custom post type for my portfolio section. When a user clicks on my portfolio link it takes them to archive-portfolio.php which displays a gallery of all my projects and when they click on a project it takes them to single-portfolio.php displaying the associated project.

    Everything is working how it should and is styled correctly, but now I would like to have the gallery, which is on archive-portfolio.php, also display under each project, which is on single-portfolio.php, making navigation between projects easy. It would also be great if when it displayed the gallery the link for the project that the user was on was excluded from the gallery.

    I’ve tried inserting

    <?php wp_get_archives(); ?>

    into my single-portfolio.php template, but I couldn’t seem to get it to work how I wanted. I couldn’t get it to grab my custom posts and it would just display a month link that linked to my regular posts. I need it to just display my custom posts and the gallery that is on archive-portfolio.php. (Basically I just want to insert archive-portfolio.php into single-portfolio.php under the content of single-portfolio.php)

    This is my first WordPress site and I am learning it all on my own as I go. I’ve tried searching for a solution on my own, but everything I find seems to just be about how to create a custom post type, which I already figured out. I am still developing my site locally which is why I can’t link to it right now, but to give you an idea of what I’m going for you can check out this site which was made with Cargo:

    https://www.timboelaars.nl/help-ink

    Basically, I want the same functionality as the example site above; I just want the gallery to display under the project.

    Any help would be much appreciated! I’ve been struggling with a solution for this for a couple of days now and have been avoiding it, but the site is almost done and it can’t be avoided anymore. I could really use some help on this. Thanks in advance!

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘How do I display the content from a custom archive page under a custom post?’ is closed to new replies.