You wrote that you have a function definition in file that you include. I suspect that the reason is the function redeclaration error.
You should move the function definition from myCustomFile.php
to functions.php
.
You can also before each function definition in myCustomFile.php
check whether there is already a function of the same name.
if ( ! function_exists('you_function_name') ) {
function you_function_name() {
// ...
}
}
Related Posts:
- Include a external PHP file into a WordPress Custom Template
- Why have on every line
- WordPress and event-driven programming – what is it about?
- Include files in functions.php
- Admin Bar (Toolbar) not showing on custom PHP file that loads WordPress
- Display a selected custom product option in WooCommerce cart
- Custom post type column which compares dates?
- Set the transport of the Customizer ‘header_image’ core setting to ‘postMessage’
- Limit the Excerpt field in WP-Admin in words
- How to create different menu’s for not logged in visitors and for logged in members?
- Setting up the child theme so as to enable right-to-left WordPress?
- Custom Loop Pagination on WordPress
- delete an array element when its date expires
- where to include a php file
- Can I change a variable in a content part while calling it?
- the_author() not working outside the loop
- Wrap First Character after in a tag
- How do I implement a .diff changeset from core.trac.wordpress.org locally?
- Put CSS inside a PHP file and include it the right way
- Random Default Avatar Function
- Customizer: Output default value in Customizer CSS
- How to add just one specific page to widget without plugin?
- Taxonomy linked to pages
- Create another “Display Site Title and Tagline” checkbox, “Header Text Color” setting and control
- Converting HTML Template to WordPress Theme
- Can I install/embed WordPress on a ‘single page’?
- How to check if a meta value has already been assigned to any user?
- code is skipping a div
- Send an email to specific adress when button is clicked?
- WordPress admin pointers tour bug?
- Using $wpdb (WPDB class) ‘replace’ with multiple WHERE criteria problem
- Custom posts in different columns style
- need help with existing code showing subpages
- How do I add a custom css to all posts without affecting homepage css? [closed]
- Correct and safe way to include php content in my page
- Advanced Custom Fields not displaying
- Exclude posts with specific metadata from search?
- Add data-id attribute to child page links
- What file have I to create in my custom WordPress theme to show all the post belonging to a specific category?
- Warning: Illegal string offset on theme options page [closed]
- php include not working in custom page
- Post’s ID pattern?
- Display Youtube Time Automate from Key
- How to fix this PHP warning in WP-Admin after upgrading to 3.1.2?
- Where is the PHP code generating an element?
- Basic wpdb update question
- Check class_exists before class definition / Doxygen problem
- Extract links from content
- Integrating Yii2 and WordPress
- Custom Registration username_exists / email_exists
- After disabling WPML multi currency, the currency is still handled by the WPML
- get_theme_mod outputs number when using WP_Customize_Cropped_Image_Control
- PHP Helper Class to create shortcodes
- Reusable code that I can store in the function.php and apply to other templates as need. Dry Code
- Is it possible to add a custom page to a free WordPress site? [closed]
- Is there a hack for using is_page() within the function.php file?
- How to Fix an Archive.php That Displays All Posts?
- Assign Custom classes to every Excerpt
- Make next post button link to random post
- Site DOES NOT LOAD after 3.1 update
- Customizer control save then return to default
- WP-Bakery – Add custom colors to buttons with template colors
- update_user_meta as multiple value but with same meta key
- retrieve “Link Color” value
- Inserting a class on before_widget if checkbox is checked
- Delete post meta by serialized meta value
- Dynamic Banner Text based on Subdomain
- Create form which redirects to site in network?
- Redirecting the lost password page request when using a custon login page
- Remove specific javascript when viewing page in Customizer?
- Search only for posts with specific metadata?
- Running local copy of an old WordPress site on MAMP
- Customizing WooCommerce with PHP
- What image is this pulling?
- Is there a way to have chunks of a page’s content expire?
- Where can I find the declaration of `$_wp_theme_features`?
- Static home page ignored
- How do I routinely extract the thumbnail of the most recent post?
- Showing the project type in HREF
- Display tab title as ‘blog tagline | blog title’
- My customizer’s setting doesn’t set to the default and needed to click the control’s “Default” button before it’ll be set
- Showing custom field contents without listing description
- How to use PHP code with wordpress page
- Check if values exists DB
- if is_bbPress register jquery
- Auto create description in post
- Pagination on Custom Loop
- error with WP custom form
- How can I clear the theme mod settings?
- MySQL Engine vs. Charset
- Custom PHP-coding in MU installs
- Date when the custom field was added
- Shortcode not passing variable to included file
- Select area and checkbox data is not saving?
- How to include a php file in every post and page [duplicate]
- wordpress.org disallowing my plugin becuase of loading core files in cron cpanel file
- In reading settings posts are set to “blog” and I have page-blog.php but no posts
- WP Custom tables query
- hello can you advise how to fix the error?
- Add multiple HTML attributes to an Elementor button