I'm in index.php and I'm trying to create a list of links to the archive pages for three custom post types I've registered. Here's what I have so far:
// Get custom post types, excluding Wordpress' built-in ones
$cpts = get_post_types( array(
'_builtin' => false
));
// Get a name and a link to the archive page of each custom post type
foreach( $cpts as $cpt ) {
$name = get_post_type_object( $cpt )->labels->name;
$link = get_post_type_archive_link( $cpt );
echo "<a href=$link>$name</a>";
}
The code works well except that, in addition to the three custom post types I've registered, a fourth one comes up whose $name
is Logs and the $link
is my site's homepage url.
What is this 'Log' post type? Is it Wordpress' default Post? Shouldn't the _builtin => fakse
parameter for get_post_types
exclude it already? If not, how do I exclude it?