You can include multiple files in your functions.php
. I do this to keep things organized. All my functions are in a functions
subfolder, so my functions.php
file just looks like this:
require get_template_directory() . '/functions/function-1.php';
require get_template_directory() . '/functions/function-2.php';
require get_template_directory() . '/functions/function-3.php';
If you have functions you only want called on certain pages, for example, you can do this:
if ( is_page( 'registration-form' ) ) :
require get_template_directory() . '/functions/registration.php';
endif;
Related Posts:
- The correct method to pass query vars in AJAX using ajaxurl
- Display user’s total comment count outside The Loop
- Getting the action’s tag name within the action
- WordPress Infinite Scroll without using any plugin
- Admin Bar (Toolbar) not showing on custom PHP file that loads WordPress
- How to add query vars with paginated URLs?
- How to change “Shipping Calculator “field label on Cart Page – woocommerce? [closed]
- How to get user by display_name with WP_User_Query
- Changing Link Attributes for Wp_Link_Pages
- Unusable menus and “Illegal widget setting ID: nav_menu_item[]” error
- How to change
- Get only the grandchildren, not the direct children of page/current page?
- Passing POST data from one WP post to another
- Use wp_remote_get to get JSON instagram feed from public profile
- How to add SVG icon above product tab title
- WP_Query sort using multiple numeric meta values
- Call to undefined function issue
- wp_insert_post() is returning the correct post ID, no failure, but the post content does not get updated
- How can I generate random numbers inside my shortcodes on each implementation?
- custom widget on the footer
- WordPress automatically adding html tag around PHP code
- WordPress does not load page.php, return 404.php
- Converting HTML Template to WordPress Theme
- How to hide all child pages with post_query?
- Saving an array of dynamic repeater data as post_meta
- How can I apply_filters from inside a function?
- Image rotation and editing stopped working in WordPress after upgrading Ubuntu from 16.04 to 18.04
- How do I start using an external API and PHP for a WordPress.org page?
- Populate editor with some content of a page with a page template
- I want to load in a new class but only if the current page is single-movies.php
- wp query foreach deleting record returning only first or last item
- Customizer: Category Select Sanitize
- Using $wpdb (WPDB class) ‘replace’ with multiple WHERE criteria problem
- Skt full width basic slideshow problem
- RTL Stylesheet Confusion with WordPress
- How to create an ACF shortcode with Repeater Field in WordPress? [duplicate]
- get_template_part() not firing within a switch statement when template has new WP_Query
- How to show/hide php table rows based on the content of custom fields
- How to determine from a different folder (outside wordpress) if a visitor is logged into WordPress
- Is a series of update_option calls safe, performance wise?
- how to get serialized post meta
- Scheduling an event inside plugin class is not working
- How to catch wordpress post ID when it’s published
- Does get_post function counts as view?
- Get ACF options field in PHP acting as CSS
- Permalinks are not working in WordPress in digitalocean
- PHP code inside Shortcode
- Amend theme php to include certain category in header
- add category to posts with tag wordpress
- Missing a text-domain esc_attr_e
- Get all posts from categories
- How to insert data from metabox to custom table
- How to Generate a list of Most Commented post?
- Updating From Mobile App – Exposing Site to Hacking
- call adminbar greeting in other place
- is user member of a group, show them categories [closed]
- How to add ASCII symbol after each recent post [closed]
- WP_LINK_PAGES Generating Unnecessary Tag
- Why is home page content not displaying with this rewrite rule?
- Add class to ul and li in wp_na
- How can i programmatically change the SKU of a product based on product variation?
- Export post data with xml to other site using php soap
- Execute PHP code only with specific user role
- Repeat a function with 24hrs gap for n number of days
- How to serve WordPress folder over subdomain?
- PHP function for horizontal Woocommerce thumbnails and badges
- How to call my PHP function with AJAX ? wp_query
- How to route root path / to /xyz in nginx?
- Get the same SKU from woocommerce itself for simple and variable products
- Show sidebar only to author of post
- No more get_option(‘date_time’) in WordPress 5.5?
- The style.php file inside theme-engine folder has other content on FTP
- how to add custom select field to wordpress edit page
- How to update post content of all posts with tag?
- Make WooCommerce product categories only show images on homepage
- How to Change Site Elements based on referring URL
- WP post meta – for loop inside for loop
- Insert data from form to database
- My search results are only showing 5 posts?
- WP_query meta_query slow with OR and DATES
- WordPress Query Crashes Browser
- Matching multi user
- customizer live preview layout picker
- WordPress using get_term to retreive slug not working as expected
- auto metakey value on post tile
- On a custom template, should I use wp_footer? [duplicate]
- Front end post submissions do not get submitted in the category
- How to pass parameter that ends up being part of a class name with wordpress shortcode
- how to check for wordpress Query errors
- calling a function from a class in your template
- WordPress and magic quotes
- Dynamically pull the correct email address from a match
- Custom single.php files for different post formats
- Troubleshooting “loopback requests that take too long”
- AJAX & PHP | Call a specific PHP function from a PHP file via AJAX?
- Order woo products, but first products must be with acf fields
- Remove /category/ from category (archive) page URLs (without using a plugin)
- JSON Object Value Show Undefine
- How can I change the URL via add_rewrite_rule()
- How can I change the location where the custom field is displayed in the Quick Edit tab in WordPress