The WordPress method to include php files is to use this function:
<?php get_template_part('myfile'); ?>
which will include the file myfile.php that is in the same template directory.
See http://codex.wordpress.org/Function_Reference/get_template_part for other parameters.
Related Posts:
- What’s the net::ERR_HTTP2_PROTOCOL_ERROR about?
- Undefined function mysql_connect()
- MySQL column count doesn’t match value count at row 1 [closed]
- Override get_template_directory() in child theme?
- WordPress AJAX Pagination with query_posts
- Only Showing Upcoming Events
- Check if post of title already exists
- Static Frontpage Pagination – Custom loop
- Check if user already visited this post today
- wp_signon always passed the password eventhough password is wrong
- How do I remove a require_once admin panel from the parent theme from the child theme functions.php?
- Removing jQuery migrate and working with dependencies
- WordPress admin never finishes saving page on site with large page count
- populate dropdown wordpress form from database custom table
- Prevent publish status/date saved on transition_post_status hook
- Trim first 2 words of the exceprt
- How do I put the homepage link inside the php _e code?
- Appending meta value onto post content in WordPress during save_post
- sql query to put quotes around numbers in img tag
- Problem with WordPress Ajax form
- Header has extra HTML block at top before my code
- If Meta Checkbox is checked, do something?
- Output 2 items within the Loop
- Why does running get_the_excerpt() when generating JSON file take 28 seconds vs. 599 milliseconds without it?
- How can I add pagination and how can I change thumbnail size?
- APC 500 Internal server error [closed]
- Call External Object in Class Function During Callback
- How can i upload images in an admin page?
- Why do WordPress rewriites seem to work differently for posts vs pages?
- Performance impact of rewriting WordPress URLs
- WordPress: Access a plugin from within a theme
- wp_ob_end_flush_all and wp_suspend_cache_addition()
- edit_comment_link is not showing for comment author
- Css loads very slow [closed]
- Why is image hard cropping for one image using add_image_size not working?
- wordpress archive a user
- How do I get around “Sorry, this file type is not permitted for security reasons”?
- How to change theme programmatically from a external application?
- Hide Featured Image Meta Box on Editor Screen
- how to test for all children (including multilevel grand-childern) of page
- Dilemma of Populating all the categories in a drop down list
- Add item to top of menu using a filter in functions.php
- How to include seperate PHP file to class in callback function
- JSON REST API WordPress only showing first 10 categories
- Password minimum length in personal subscription [closed]
- echo something inside a shortcode
- PHP include statement not working?
- require_once() if a product in woocommerce contains a tag [closed]
- How to pass a variable into an add_filter() function?
- Can not add admin notices from the edit_user_profile_update hook (notices not being displayed)?
- Only show first image in foreach loop
- How to send a HTTP Post request using PHP Curl and WordPress
- How can I find the cause of a 500 server error?
- php preg_match with multiple patterns
- Shortcode for Listing Users from Meta Value?
- I can’t update my data through $wpdb
- How to suppress template-parts in undescores?
- How run a non-WordPress PHP Program on a WordPress site?
- Wpdb get->results to out the the month from the db
- The session works on the local server, but not on the web server
- Returning all values from foreach in function php [closed]
- Display css ONLY on most recent post of specific category?
- Conditional string comparison failing for basename/slug
- Deeper editing of index.php and single.php
- add the value of a variable returned in a while loop [closed]
- Page Options Saving But Not Updating In Backend
- Using a string from a custom field within a link
- Function to add DIV Class?
- How to redirect non logged in mobile users to page on same site?
- How to WP_Query posts order by parent title?
- search.php to search only the post title
- Filter wordpress posts without searching the keywords in the post content
- REST api returns 404 on some WordPress sites
- portfolio site – about this site section – is it safe to post some code
- How do I edit the terms output args or array data?
- Change the URL of an image from wp_get_attachment_image_src for Product Posts based on Category
- WP custom posts: filter results to custom taxonomy tag that corresponds to user meta field
- Combine change Email WordPress and woocommerce emails template
- When I click for the redirect link it is showing the content of index.php instead of single_assignment_page.php
- Adding variable in WordPress shortcode
- Get custom field value from the function.php
- Non-blocking file_put_contents in function.php
- Call a single function on two different methods with hooks
- Use WP Cron to Clear a Page Cache?
- How to get Post sidebar & footer including html like get_the_content() which only gets content section?
- Automatically refresh page if widget is added to page?
- Add custom taxonomy to custom search for posts
- extract url from a hyperlinked string in PHP [closed]
- Published custom posts missing
- PHP version or config prohibiting script from working properly
- media-uploader insert into post is not inserting
- Include a php file that is above WP installation hierarchically?
- Two loops in one function
- How to hide something from custom home page with php code?
- Using the same shortcode to show any table from the database
- How to refresh a template page on WordPress in 3 seconds – easiest method?
- Load Meta box value into div AJAX [duplicate]
- Reading CSV values and showing them in PHP
- Functions.php file in a custom child theme messed up without backup
- Retrieve Array from within Array [closed]