WP: Add custom post type to admin dropdown to be able to chose it as homepage

1
2
<?php
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
In case anyone would like to include this feature:

1. Copy paste this snippet in your functions.php file.
2. replace method names to suit your needs
3. Make sure you replace the "index-page" value which corresponds to your CPT type.
4. You're done! Visit Settings > Reading in your admin, set "Front page displays" to "A static page (select below)" and open dropdown. Your custom post should be there.

Be the first to comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.