If it is a custom theme for your site then there would no great speed or security improvements by moving functions.
On the other hand if you want to distribute the theme then I recommend having only the minimum php in the page templates files and having the rest of the functions organized in different files. I like the basic theme set up files of the theme to be in the functions.php and the rest in separate organized files. _s does a good job of this. The reason for moving the functions away from the templates files is that it makes it easier to customize and manage. If you need to duplicate a template then you do not end up duplicating functionality.
I would even place the non-presentational functions in a plugin for easy deactivation and management. See this answer for more information.
Related Posts:
- When to check if a function exists
- Maximum lifetime for nonce
- Create a free scripts and styles template within a plugin
- How can I turn a custom wordpress page into a product page?
- How to modify files inside wp-includes directory in wordpress
- Customise Grouped Product display in Woocommerce with custom column
- Does hooking into a plugin action / filter override the plugin’s function for that hook?
- Add function to Dokan ajax class
- Template file structure , wordpress hook for altering the template
- Dynamic banner for use on external sites
- Sticky bar with filter button and product count
- Override class inside $atts shortcode_atts in WordPress
- creating custom function to log actions in plugin
- Is it possible to change a term slug before being saved to the database?
- add_rewrite_rule works in themes function php but when moved into plugin it stops working
- Can Page Templates be Applied to Archive and Post Templates?
- ORDER BY wp_post custom column name in wp_query
- Clearing caches on plugin uninstall
- How to use a hook to override an update_post_meta call in a plugin?
- Add code inside specific wordpress standard function
- How to customize a permalink (URL) structure?
- Where can i find wordpress auto update code flows?
- Custom Taxonomy to dropdown box on adminside wordpress
- Edit Yoast SEO breadcrumbs output [closed]
- Adding option to Gallery shortcode
- correct way to call javascript into hook function
- How to modify the comments to be displayed in a post?
- How to change the hover content of a specific menu item on WordPress?
- how to search users by ajax live search
- Retrieve $_POST data submitted from external URL in WordPress(NOT API)
- How can we display product price $104 on the cart while the credit card payment method is checked?
- Incorporate small angular feature in my wordpress site
- Remove unwanted elements for a wp_nav_menu
- How do I update a field of a meta box?
- How to Bind one post object Type with other postobject Type in Advanced Custom field [closed]
- How to add user details to different tables immediately after user registration
- Search: how to extend the existing search to include a custom table
- Is there documentation reference for forms in menu and setting pages?
- mysql_real_escape_string() vs. esc_sql() in WordPress
- Plugin templates vs Parent Theme
- WordPress function get_the_terms() returns ‘Invalid taxonomy’ error
- Checking for existence of a page by title?
- how to get context information inside my funcion
- Enqueue script globally
- How to make “upgrade safe” theme for a plugin?
- WordPress class, using add_action to call member function does not work
- Redirect to another page using contact form 7? [closed]
- How should I go about registering JavaScript that isn’t a file? [duplicate]
- Fatal error: Call to a member function get_page_permastruct() on a non-object
- wp_get_post_terms Order by not working
- What action hook can I use to add a JavaScript to a page post using a theme template that is not including get_header() nor get_footer()?
- Custom entity search and display
- Function/Class to list categories with checkboxes
- How to obtain the current website URL in my theme?
- What exactly do this function declared into functions.php file of a WP theme?
- How to set a cookie for logged in users to md5($user->ID . “my_secret”)?
- wp_get_theme Warning: Illegal offset type
- Plugin: database creation
- Loading Modernizr (or other JavaScript libraries) for use in a plugin
- Why wp_die() doesn’t work with wp_redirect but exit() works
- Warning: call_user_func_array() expects parameter 1 to be a valid callback
- Show message from backend
- Print Dashboard submenu name and filename
- Autogenerate a Table of Contents
- Alternative functions for mysql_free_result and mysql_ping in wordpress functions
- Why in this archive page that call query_posts() function show only the last 10 posts?
- Create Widget or Enable Shortcodes in Sidebar
- WordPress multisite,use same cookies across all website?
- Apply styles to blockquote element with the WYSIWYG editor
- Function Reference Documenting Template Tags for use in Custom Theme Templates?
- Call to undefined function is_home() or any conditional tags
- How to create templates for a custom module to show on the front end within my theme?
- Create page template via functions.php?
- unregister_setting() vs delete_option() for plugin update
- How to change WooCommerce loop product title HTML output in single product page and archive page
- Logout after clicking URL link results in “headers already sent” error
- Why aren’t some plugin styles loading when I load a template?
- Plugin custom post template; without overriding all posts
- How to output functions from plugin inside theme
- how to save wp_editor html content in options table
- wp_schedule_event is registered but function isn’t running
- Converting core modification to a plugin
- Best way to distribute templates and code accross multiple wordpress sites?
- How to use a WP_Customize_Control outside of the Customizer?
- Overwriting a plugin function
- Writing editor content to a file
- How to replace settings in WordPress plugin from a theme
- How to remove/replace current page template?
- Load php file with jquery in single.php
- Remove Permalink Meta Box not working?
- Adding tables to dashboard pages programmatically?
- Setting a post’s category
- Setting post_id for single.php based on URL without a redirect
- using admin functions on frontend
- Javascript Function Called Too Early in PHP Script
- Modify code for functions.php with specific twitter user url and hashtags
- Extract Information from post content (using regex?)
- can’t access some WordPress function from my plugin
- WP 3-way voting system: On to something! Please help!
- How to determine which capability to use?