This code enables you to remove one or more pages from your custom post type archive page loop.
Simply add the code to your child themes functions file and replace the post I.D in the following code with your own post I.D or comma separated post I.D’s for the pages you want to exclude from the archive.
You’ll also need to swap out the name of the CPT (portfolio) with your own.
Was This Tutorial Helpful?