Issue creating an archive.php for Custom Post Type

Forums › Forums › Search & Filter Pro › Issue creating an archive.php for Custom Post Type

Viewing 10 posts – 1 through 10 (of 11 total)
  • Anonymous
    #156386

    Hi everyone,

    In order for Search & Filter Pro to work like we would like, we have to make a archive.php for our custom post type. We have experience in making archive.php templates for custom post types but in this case we have to create it using a loop.

    We’ve got a custom post type named ‘catalogus’ and made a archive.php for it using these instructions http://www.wpbeginner.com/wp-tutorials/how-to-create-a-custom-post-types-archive-page-in-wordpress/ but unfortunately we’re seeing no results on that archive page.

    Could you please point us in the right direction with getting the right archive page?

    Trevor
    #156394

    What name did you give the file?

    Anonymous
    #156449

    Hi Trevor,

    The file name is archive-catalogus.php

    Best regards,
    Robin

    Trevor
    #156464

    Have you tried the Custom method on WP_Query?

    You can then add the search form to the arguments in your template file:

    https://www.designsandcode.com/documentation/search-filter-pro/search-results/custom/#WP_Query

    Anonymous
    #156649

    Hi Trevor,

    We’ve tried the Custom method on WP_Query. We have also added the search form arguments but the archive page doesn’t show any results.

    You can find the code from archive-catalogus.php here: https://gist.github.com/Bjornftw/399679b0dc23004c3645c6976d86689c

    The strange thing is, as soon as we add the code ‘search_filter_id’ we won’t see any results anymore. If we delete that line (‘search_filter_id’) we do see results.

    Best regards,
    Robin

    Trevor
    #156694
    This reply has been marked as private.
    Anonymous
    #156786
    This reply has been marked as private.
    Trevor
    #156931
    This reply has been marked as private.
    Anonymous
    #156947

    Hi Trevor,

    Thanks. We’ve removed it. Now we do see the archive page on http://staging.lunaworx.nl/catalogus but somehow the filters don’t seem to work. Whatever we do (select a price range with the slider or search on a specific term) we always get all of the results.

    Best regards,
    Robin

    Trevor
    #157033

    Can you find the Ajax Container setting on the Display Results settings tab, currently set to #main, and change this to #left-area?

Viewing 10 posts – 1 through 10 (of 11 total)
Search & Filter Support
Privacy Overview

This website uses cookies so that we can provide you with the best user experience possible. Cookie information is stored in your browser and performs functions such as recognising you when you return to our website and helping our team to understand which sections of the website you find most interesting and useful.

We also use cookies to store items in your cart as well as allowing your to login on the site.

You can adjust all of your cookie settings by navigating the tabs on the left hand side.

By continuing to use this site, you also agree to our Privacy Policy.