OK. I’m assuming you have WordPress setup as a sub-directory of your root URL. If so, this should work:
<?php include 'http://www.site.com/file.php'; ?>
Sometimes people write the include special form with parentheses. In most cases it won’t break anything, but if your code looks like this, try removing them:
<?php include('http://www.site.com/file.php'); ?>
Also, make sure that the “WordPress Address” and “Site Address” are both set to the proper URL in the admin settings. This might throw off your absolute URL.
Related Posts:
- Include WP_Query in my own PHP file?
- esc_attr() right way and use
- Include a external PHP file into a WordPress Custom Template
- Include files in functions.php
- Is having multiple theme customizers for different pages possible?
- Detection of theme being used
- reason of splitting theme files to multiple files
- Set the transport of the Customizer ‘header_image’ core setting to ‘postMessage’
- Replacing mysql_real_escape_string in WordPress theme
- The best way to customize “nav-menu-template.php” to add if the ‘link_before’ is “checkbox”
- Can’t Find a Way to Edit the Home Page Content [closed]
- Use different javascript files for each page on website
- Fatal error: Call to undefined function wpsc_cart_item_count()
- How to get custom image size for image uploaded in Customizer
- Widgets not showing in my custom theme
- Want to create Child theme, but already edited Parent theme css files and some php files
- integrating external php library into wordpress- the right way
- Adding code to child theme functions.php to override parent theme behaviour doesn’t work
- the_author() not working outside the loop
- How the functions in WP are called in tags
- Add a Second Menu to a theme that only support 1 menu
- How do I use the Simple HTML DOM Parser in plugin when other plugin already uses it?
- Warning: Use of undefined constant HTTP_USER_AGENT – assumed ‘HTTP_USER_AGENT’ (this will throw an Error in a future version of PHP)
- Put CSS inside a PHP file and include it the right way
- Can’t load WP function into external function
- Custom Theme, Custom shortcode not working
- Customizer: Output default value in Customizer CSS
- WordPress does not load page.php, return 404.php
- Adding custom directory and PHP files in wordpress
- WordPress add post format support not working
- WordPress: Access a plugin from within a theme
- Connect WordPress with SharePoint [closed]
- WordPress Shortcodes.. printf is outputting a random number… Can’t figure out WHY?
- code is skipping a div
- My page.php shows the index.php
- Compare the old get_theme_mod($name) to the new get_theme_mod($name) return value
- How do I link a button I created in theme customizer to a function?
- How to change theme programmatically from a external application?
- Is the “_s” on this `sprintf(__(‘Page %s’, ‘_s’), max($paged, $page))` just refer to a text domain?
- Why does abstracting html from plugin code result in loss of access to wordpress functions?
- Does wordpress templates always in files or in database?
- proper way to add css using functions.php?
- PHP include is only working in certain places in my custom WP theme
- Reason to add a name of the theme like (‘menu-1’ => __( ‘Primary’, ‘twentynineteen’ ),) in PHP?
- Separation of presentation and code – WordPress
- What is the proper way to include a PHP framework into my theme?
- get_template_directory adding FTP root folders in urls
- What’s the best way to include PHP code in pages?
- Use $variable from file1.php in file2.php (different file paths)
- Warning: printf(): Too few arguments in helpers.php file
- Design with Elementor and code the rest?
- WordPress and PHP Version Upgrade issue [closed]
- blank white page when post/update/change option etc
- How to Update an old theme for the latest wordpress version
- get_comments_number() returns 0
- Fatal errors to undefined function in theme 404.php file [closed]
- Implementing custom tag/tax pages
- ‘Bones’ theme: Load stock scripts in footer instead of header?
- Why in this WordPress theme I can’t see the Main Menu?
- Displaying Slider in Front Page (home) using Customizr Theme
- Editing Theme Files on WordPress.com-hosted Site [closed]
- call a string/function from database
- Some problems calling a function into sprintf() inside functions.php template file [closed]
- How do I call an external php non WordPress class into functions.php?
- How to set all External Domain Links with nofollow Attribute from Header Footer Content and Excerpt using PHP?
- Uncaught TypeError: extract(): Argument #1 ($array) must be of type array, null given
- How do I use an iFrame for my header in WordPress twenty seventeen?
- When I click for the redirect link it is showing the content of index.php instead of single_assignment_page.php
- How to use data URL in WordPress?
- wordpress email checker on domain
- Unable to retrieve get_author_posts_url
- Force Sidebar on Full Width page
- Before & After Content – After Content directly below Before Content when using require_once
- Add the shortcodes from the enfold theme to the other theme
- WordPress child theme, creating a custom php template page
- How to get Post sidebar & footer including html like get_the_content() which only gets content section?
- Menu to the right of screen on desktop using Bootstrap 4
- How do I fetch a data from an external database into my wordpress homepage
- style.min.css code issue
- Beginner Developing Theme with Bootstrap – NavMenu question
- Local WordPress from Git repo, where to set document root?
- Editing existing pre-created menus in PHP
- WordPress pagination broken on blog page, working for search results page
- Shortcode Display From WordPress Dashboard Page Without Using post_id
- How do I / Is it possible to execute an external PHP file / function inside WordPress?
- How can I print out a single stylesheet or javascript link?
- php “use” not working in template [closed]
- WordPress menu links with images & class selection
- wordpress.org disallowing my plugin becuase of loading core files in cron cpanel file
- Link a lightbox thumbnail to a post instead of opening the lightbox
- Predefine Magazine Style Layouts
- How to remove the intro animation which appears during the load up of some WordPress themes? [closed]
- How to store the_post_thumbnail() value in a variable
- a problem in class in class-wp-hook.php
- Using Featured Image as Hero Background in Word Press
- Gulp dev environment set up for WordPress theme development
- WordPress theme requires PHP v >=8.1 – How to a dd different PHP version to docker-composer
- The theme doesn’t load css and JS files doesn’t load in functions.php
- Upgraded php & wordpress but theme broke
- Woocommerce Select Option Popup [closed]