This is probably because you just should never directly access anything which is not JS, CSS or images on theme folders. Directly accessing PHP files in those folders is considered a security risk and people (me included) will block such an access at the server configuration level.
I assume that depending on the method used to hide the files, the webserver might not even be able to “see” that the file is there and will ask wordpress to resolve the URL which will end UP in a 404 page. But it doesn’t really matter why, just don’t write code like that.
Related Posts:
- Why is wp_head() creating a top margin at the top of my theme header?
- how to create a conditional content_width for a wordpress theme?
- How To Add New Option Types To Option Tree?
- How to limit wordpress menu depth in admin panel
- Modular theme settings
- Trigger Customizer saving process with Javascript only
- How to determine the current widget’s parent container (sidebar widget id)
- Comment form not display properly?
- How to add menu support to a theme?
- Setting up partial Right-to-Left admin interface
- Moving functionality from functions.php to classes?
- Registering Sidebars and Sidebar Widgets. Sidebar Widgets Not Displaying
- Custom nav menu is created with default pages, but not hooked to theme’s custom menu location
- How to pass code from header.php to footer.php
- Extend walker – navigation, adding data attribute to a tag
- How to display category specific post content on a page
- Move my theme style.css into a folder
- how to change WordPress menu markup/classes
- Best practices: Custom theme sidebar menu – hardcode or widget?
- Is it a good idea to make whole theme widgetized?
- Gutenberg Reusable Block as part of WordPress Theme page
- Why is $GLOBALS[‘content_width’] needed if site is responsive?
- Does WordPress count as a means to learn web development? [closed]
- current-menu-item class not working
- Prevent theme from activating [duplicate]
- Messing up with transient API – getting flushed on refresh
- Correctly using wp_head()
- A mystery 300px image size
- Cannot figure out how to overwrite files in child theme
- Inheritance of parent theme plugin files in a child theme
- Display a list of certain categories by ID
- Implementing FancyBox
- Single Page Design, Storing in Theme Options
- How to append to menu items selectively
- Working with a WP Starter theme
- Child theme enqueue scripts using new functions
- Should I change text-domain of TGM library inside theme?
- tag is being auto inserted
- Custom theme updater – random string in new theme name
- Show woocommerce categories on my theme menu styling
- “Bad element for masonry: undefined” why this error us occuring? [closed]
- Scroll to position on page for category pages only — woocommerce
- How remove render blocking css from wordpress when you build a theme?
- Displaying details of a post in a sidebar
- How to upload/update theme from local – bitbucket – shared hosting?
- Inserting images in multiple posts native gallery
- correct tags for validating input types
- How to remove header image in Twenty Eleven theme?
- How to query the latest 5 posts and sort them by title?
- Is there any tool to find lines of codes responsible to generate front-end HTML elements?
- Template Tag “template_directory” pulling wrong path
- wordpress 404 not found after rewrtie the author link
- Will my site get messed up when the wordpress theme updates if I edited the html code in the editor to change footer?
- Have the homepage look different to index.php without a static page
- the_post_thumbnail() get the URL to the “medium” sized image
- Can I make a Customizer dropdown-pages list include private pages?
- Do I need to escape get_the_post_thumbnail function?
- Why is switching between themes breaking my child theme?
- How to style bootstrap container in wordpress theme?
- Wamp Server error on running wordpress theme on localhost. How do I fix this error? [closed]
- How to disable WordPress to put P tags?
- CSS preprocessor file messed up after compiled
- $_POSTing to and modifying the WP search results page
- Confused by the behaviour of “front page” / “home” templates
- How to Grab first Image from some Chosen Categories
- Get themes’s images path in WordPress Multisite
- Get video from the post on homepage
- WordPress Themes Directory: Template which hits the standards?
- How to change a local wordpress installation xml export file urls? and change them to what if you don’t have a live website?
- How to get URL of category of a custom post?
- Is there a plugin for versioning files in the theme (style , .js and .php files)?
- get_avatar() is not working in my custom theme
- Getting post URL within custom content template
- When I save changes for css and js in my WP localhost env windows 10 the changes don’t take effects immediately!
- Updatable theme developing
- Getting unexpected warnings from theme options code
- Block validation failed for `core/pullquote` after adding theme support for editor-color-palette
- makeing a terms of use page that is part of the theme
- How to make menus, footer, sidebars multi language
- Different templates for each category level
- Child theme in separate WordPress Install
- Display problems in admin dashboard when creating a new theme from scratch
- wp_nav_menu custom walker class
- Using Customizer value in an external PHP file inside a theme
- Changes to template not showing up unless ?reset=1 added to URL
- How to add drop symbol to parent nav items which have child
- How to avoid Ajax in wordpress theme in making mulitple request?
- Enqueue Stylesheets After Theme’s “rtl.css”
- WordPress 3.5 + Foundation 5 not working on IE9
- Any disadvandages if I style the wordpress align classes without img and .wp-caption prefix
- Using wp_enqueue_script with social media buttons?
- Want to include ad code after related post
- How can disable function wp_link_dialog()
- Pagination adds product to cart Woo-Commerce
- Onepage with shortcodes
- Allowed memory size of (…) exhausted
- How to create full header but keep content narrow
- Creating image grid on products page in wordpress
- Insert gutenberg blocks into template
- How to make it so I can “use” template parts in (classic/full) site editor