The Classic Press Theme gives a warning in logs

Hi all, I was browsing my logs and discovered this in them:
[07-Sep-2025 15:39:29 UTC] PHP Warning: include(): Failed opening ‘/home/username/public_html/wp-content/themes/the-classicpress-theme/menu.php’ for inclusion in /home/username/public_html/wp-includes/template-loader.php on line 108

After looking through the index.php file I found this:

function susty_register_query_var( $vars ) {$vars = ‘menu’;return $vars;}add_filter( ‘query_vars’, ‘susty_register_query_var’ );

add_filter( ‘template_include’,function ( $path ) {if ( get_query_var( ‘menu’ ) ) {return get_template_directory() . ‘/menu.php’;}return $path;});

Should the theme ship a menu.php, as I couldn’t find one anywhere or should this filter be guarded (e.g., use locate_template/file_exists) so it only switches templates when menu.php is present?

If this behavior is intentional, where is the location/content for menu.php?

The ClassicPress Theme is based on SustyWP. This starter theme has a peculiar feature, the menu opens in its own page, that has a template called menu.php (check out the GitHub repo for SustyWP that I linked, you will find that the menu.php template is indeed present in the starter theme).

The ClassicPress Theme changed the way the menu was rendered and removed the menu.php page but some of the lines of code that were relevant to the old menu feature in SustyWP remained there unattended, and are now throwing errors. (it’s not easy to do a complete cleanup of a theme feature sometimes, only reports like yours can highlight an issue sometimes).
Uncomment those lines by putting them inside /* code */ for now so that the theme does not throw the errors. I will try and review it and do a PR for that issue within the end of the week so that core team can review it and merge for next planned release.

1 Like

After having contact with Elisabetta this PR is created.

Guido

2 Likes

Thanks for the clarification ElisabettaCarrara. I will just comment it out until a fix is available.

1 Like