Page Template as Custom Post Type Archive

My goal is to have the slug www.domain.com/resources used by a Page Template rather than an Archive Page, and have single CPT posts as children of that slug, such as www.domain.com/resources/post. Solution I thought would work: I created a new Page in WordPress and gave it a custom page template. I’m also registering my custom … Read more

Custom Post Type Template – Archive

I have a custom post type, called ‘job’, and I have the following templates in my theme: single-job.php (works fine, displays single job as expected) archives-job.php (is not recognized?) archives-current.php (also not recognized) archives.php (is not recognized either?) index.php (archives page uses this page) Here is how I’ve registered my custom content type in functions.php: … Read more

Adding custom post type archives to a WordPress menu

Is there a way (besides adding a Custom Link) to add a custom post type archive to a menu in WordPress? If it’s added using a custom link (e.g. /cpt-archive-slug/), WordPress does not apply classes like current-menu-item to the list element, which presents challenges when styling the menu. If the custom link contains the entire … Read more

Custom Post Type Settings page, choose page to display archive

So, I followed the accepted answer of this post Possible to add another setting to ‘Front page displays’ setting for Custom Post Type but didn’t entirely work, had to compare against the accepted answer in this post. Can’t output do_settings_sections . Can’t understand why Now, it actually works using the following code //Add settings to … Read more

Create a custom archive page for a custom post type in a plugin

I’m writing a plugin that creates a custom post type named “my_plugin_lesson”: $args = array ( ‘public’ => true, ‘has_archive’ => true, ‘rewrite’ => array(‘slug’ => ‘lessons’, ‘with_front’ => false) ); register_post_type (‘my_plugin_lesson’, $args); The custom post type has an archive, and the URL of the archive is: http://example.com/lessons I want to customize the look … Read more