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
- Function to return true if current page has child pages
- Include WP_Query in my own PHP file?
- WordPress and event-driven programming – what is it about?
- Cleaning up WordPress to improve performance?
- List of all theme customizer control types?
- Show the most popular post per week
- Add a class to links in the visual editor (how to get old dialog back)
- Get author full name
- Include files in functions.php
- Remove option to allow trackbacks/pingbacks from post page options
- Receiving Stripe Webhooks on a wordpress website
- How to remove hardcoded characters from playlists?
- Creating custom Woocommerce attribute taxonomies from a plugin
- Integrating WordPress to my website, while keeping my own authentication system
- Remove/unset options field from backend Settings->General?
- load/require specific php files for specific pages/templates/post types
- Display posts by month
- How to preserve PHP modifications while upgrading WordPress?
- What would be a PHP command to erase all posts from category X from the last month?
- Add a wp editor to custom plugin and save data
- Admin Bar (Toolbar) not showing on custom PHP file that loads WordPress
- Display a selected custom product option in WooCommerce cart
- Removing jQuery migrate and working with dependencies
- Load post content into iframe
- is there a simple way to list every templates / php files used to generate a specific page?
- wp_customize_image_control default value
- Custom post type column which compares dates?
- Set the transport of the Customizer ‘header_image’ core setting to ‘postMessage’
- ob_get_clean returns empty string, ob_get_flush outputs string
- Walker class: Problems with understanding how walk() method can be called without error
- How to Use the Function is_user_logged_in To Display Different Menus?
- How To Customize Position of »add to cart« of WooCommerce on Product Page [closed]
- Change comments form title on a page by page basis
- 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?
- Search and Replace in database: How to replace data in SQL dump file on Windows?
- WordPress Customizer: How can you have multiple active callbacks on one control?
- Add value to usermeta without removing previous values?
- Edit postmeta when user changes user role?
- Setting up the child theme so as to enable right-to-left WordPress?
- Custom Loop Pagination on WordPress
- Authenticating to WordPress, using my own authentication two-factor system
- delete an array element when its date expires
- Infinite-Scroll Plugin and Jetpack Infinite Scroll Plugin – Adding to “Thoughts” Theme
- where to include a php file
- How to add default images into theme customizer image control?
- String replace WordPress Site Title
- Is it recommended to pass some data to scripts in `wp_enqueue_scripts`?
- Overriding a theme redux file in child theme
- WordPress Ajax Data problem
- there’s a way to include a minimal WP for check only the current user, its roles (caps?) and then release/free it?
- Remove all nav menu classes ( but keep useful ones… )
- Widgets not showing in my custom theme
- Type hinting and void return question
- How to display custom field on homepage
- Include Class File in WordPress
- Customized title tag for each page in pagination?
- nowplaying.include.php Will Not Display Results
- integrating external php library into wordpress- the right way
- Change title and meta description in included page (not template)
- Can I change a variable in a content part while calling it?
- Add attribute / custom attribute to product in woocommerce
- How to display something in a div when the user clicks on a text in another div – no page refresh [closed]
- Why WordPress architecture is not pure object oriented and it don’t use MVC pattern? [closed]
- the_author() not working outside the loop
- How to break down importing of feeds
- Wrap First Character after in a tag
- How to create and work with custom data / tables (i.e., for arbitrary data)?
- How do I implement a .diff changeset from core.trac.wordpress.org locally?
- How do I use the Simple HTML DOM Parser in plugin when other plugin already uses it?
- PHP can I add line numbers to file_get_contents()
- How to get 2 or multiple custom post types in wordpress functions.php
- Put CSS inside a PHP file and include it the right way
- Multiple choice in a custom taxonomy
- Displaying theme options in css
- Creating bulk posts with Youtube videos
- Random Default Avatar Function
- Hide wordpress field if data is empty in post!
- Change the site tagline (or similar) based on current page
- Trouble creating conditional PHP for nav menu items with children for custom Walker
- Setting custom canonical urls
- Only show search results with if current date is between two dates?
- database interactions using OOP
- Customizer: Output default value in Customizer CSS
- How to add just one specific page to widget without plugin?
- Remove one value in dismissed_wp_pointers?
- create a select input with menus created on a custom options page
- Taxonomy linked to pages
- functions.php is being included twice, creating PHP fatal errors
- Create another “Display Site Title and Tagline” checkbox, “Header Text Color” setting and control
- Accessing data from a non-WP database/table within a page content
- Custom theme: Alternatives to long list of ‘include’ in functions.php
- WordPress blog post url on category page
- Changing layout with wp_customise
- WP dynamic featured image – Can’t get second featured image url
- Converting HTML Template to WordPress Theme
- Extending the WP_Widget_Text class
- PHP help get_template_directory + PHP include