You are trying to check it by URL, which makes no sense to is_file() which expects local path. By the way I’d use file_exists() instead.
Try:
$fileName1 = TEMPLATEPATH . '/txtfolder/file1.txt';
Related Posts:
- locate_template function – File not getting included
- Serving precompressed content with Brotli on Apache
- Is there any way to use get_template_part() with folders?
- Creating directory in uploads – wp_mkdir_p() or WP_Filesystem?
- Convenient way to use wp_filesystem
- How can I avoid code duplication for a blog with lots of source code?
- How to rename wp-includes folder?
- Moving wp-content outside of web root?
- $wp_filesystem returns NULL. What are the dependencies?
- How do I edit the php/html for a particular post?
- What’s the correct way to include files in WordPress TwentyTen theme with it’s own jquery scripts and css?
- Setting wp_temp_dir and permissions not working for “Missing A Temporary Folder” error
- ABSPATH not working! Any idea why?
- Get current user data from external PHP page
- External system integration with wordpress
- Why does get_template_part() break variables?
- How to pass variables with get_template_part?
- What is the best way to move a plugin´s subdirectory+files to wp-content/uploads-directory?
- Relative file paths in CSS when linking directly (not enqueuing)
- Problems Including File
- How to include core files into plugin
- Converting fopen/fwrite operations to WP_filesystem
- Can I delete `wp-config-sample.php` after installing and configuring WordPress?
- Put CSS inside a PHP file and include it the right way
- What’s the best way to ‘include’ a file in WordPress?
- What dependencies should I load and to use the WP_Filesystem?
- How to replace file_get_contents() with a WordPress Filesystem call
- Can not include file from plugin into theme
- Include tags from array, ignore the rest in get_the_tags
- Running rmdir function on post save
- WordPress Creates Unused (Unregistered) Image Sizes
- PHP files included within functions.php don’t work from admin area
- Wp Enviroment problem with included file
- Right way to download file from source to destination
- Having trouble linking to file using relative path
- How can I include an external file in a post or page?
- Including php file in directory above WordPress installation
- add_feed failed to open stream
- Load content From Include File within plugin
- including Zend Gdata library path error
- Pull in an “Include” file based on a WordPress Category ID
- How to prevent users to view server files using WP File Manager plugin?
- temphangle variable missing when using wp_filesystem copy
- What about “inc” (include) files and Child Theming? Is it possible?
- How to add variables to a template
- Make changes in /includes/http.php update safe
- Downloadable content file structure
- Need to override file included in parent theme
- Class works in Admin, not found on Front End
- require happens out of order
- Should I use Filesystem API for reading files or listing directories?
- Using require_once for parent-directory not working but is working in sub-directories
- if statement parent page for child pages
- Theme parts path location dump
- add_action outside a plugin
- Add page as static html into another page
- Dynamically determine URI to scripts and styles included with a class which could be added from plugin/theme/child theme/mu plugin
- How do I upload my WordPress code files from previous website onto local host WordPress website?
- Should I use include(_once) or require(_once) for loading php-file with customizer settings?
- Does unzip_file() over-write by default?
- WordPress – tracking options
- Include another HTML file in a HTML file
- C++ #include guards
- Already defined in .obj – no double inclusions
- How do you #include files in java?
- Use template_include with custom post types
- bloginfo(‘stylesheet_directory’) vs. get_stylesheet_directory_uri() and include(‘file.php’) vs. get_template_part()
- Copy a file from a plugin into my theme directory
- Can’t access wp_filesystem in cron function
- Adding extra SVGs to TwentyNineteen child theme using class TwentyNineteen_SVG_Icons
- Add few specific post ids to wp_query
- sanitize attachment filename
- Using wp_filesystem in Plugins to store customizer settings
- Where is Featured Image code stored in WP?
- PHP files included in functions.php don’t seem to work
- WordPress HTTP Error on File upload
- Is it bad to store many files in a single folder?
- Include multiple custom post types [closed]
- Image URLs stopped working due to Permalinks?
- Unable to check if image uploaded by wp_image_editor exists using file_exists function
- accessing files in custom folder in wordpress
- Where to write custom logs in WordPress
- problem including page template
- How does WordPress access theme and plugin files through its editor?
- Impossible to call wordpress function inside an include?
- Post’s ID pattern?
- include specific Pages to wp_list_pages with filter
- How to include custom PHP file both in header and footer files
- Is there a name for trivial WP PHP files like functions.php, archive php entry.php, page.php and so forth?
- Generating and downloading files with WP API
- How can I create a WordPress dynamic download counter
- how to get json file in wordpress template
- 403 Error on “/”
- Why is WP template_include overwritting all templates rather than specified page?
- Creating an .ics calendar subscription service with wordpress
- How to Call Function From Separate WordPress Install on Same Server?
- Undo a function that is not (seemingly) hooked to an action?
- Displaying $_FILES data (simlar to $_POST)
- Upgrading WordPress (File permission group owner)
- How to include a php file in every post and page [duplicate]