You can define your function in the file function.php and use it later in your theme.
Related Posts:
- Using classes instead of global functions in functions.php
- Change admin bar to default:off
- When to use esc_url, esc_html, esc_attr, and friends?
- Can’t change theme name
- Get the blog page URL set in Options
- What are the ADVANTAGES of ORIGINAL wordpress template structure?
- How to change admin bar color scheme in MP6 / WP 3.8 front end?
- Template for individual post designs
- How to edit bbPress template files – WordPress + BuddyPress + bbPress? [closed]
- Best practices – Should I create a child theme vs. customizing a framework theme? (such as HTML5 reset)
- How to disable 3.1 “Admin Bar” via script for the admin user?
- What is the best practice for customizing a plugin’s JavaScript/jQuery?
- Override default cropping in WordPress [duplicate]
- Front End Post Submit Form
- Removing the default sidebar from admin panel
- How the WordPress sidebar works
- Should we localize custom-made themes / plugins?
- Change loop order via form or link (jquery, not URL)
- Extend walker – navigation, adding data attribute to a tag
- How can I remove the Static Front Page option from the Customizer
- Set front page as static page [closed]
- How to programmatically bring back “excerpts” field in post editor in WP 3.1+
- How can i customize the comment list
- How to handle theme customization and sass variables
- wp_enqueue_scripts not called on search page?
- wp_head() not inserting the default stylesheet style.css
- Is using eval() ok in this scenario
- Custom php page in WordPress theme?
- First completely customized theme, where should I start?
- Theme Customizer not loading
- How to retrieve an image from a post and display it before excerpt of a post? [duplicate]
- Modify Javascript Configuration Options for Theme Customizer Colour Picker
- Best practices: Custom theme sidebar menu – hardcode or widget?
- Can’t access WordPress functions in file called via Ajax?
- What’s the best action to use when you want to do something only once per theme setup?
- Customizer API and add_panel(). Panel doesn’t show
- How to correctly add JQuery in a WP theme?
- how do you create an admin interface in plugin for your theme
- What is the best way to handle multiple calls to get_template_directory_uri() and similar functions?
- How to call custom function from functions.php in site-wide template files?
- trying to use wp_handle_upload with ajax
- Removing non native customizer settings from a child theme
- How to reorganize the items returned by wp_list_comments()?
- which is the best way to customize nav-menu-template.php?
- Where should I update_options in a theme?
- is_customize_preview() like function to check if Customizer “Live Preview” in JavaScript
- after renaming my wp-content folder, how do I upgrade my wordpress version?
- How do I Add images uploaded in the post to a default custom field
- How to add a button which saves the post then executes a function
- Limitations when modifying wp_title with a filter
- Pass variable to hook. Its possible?
- How to edit theme functions file to modify pagination?
- Best practices regarding the creation of custom widgets?
- “Add A Widget” button in the Customizer
- Q: How to pull data from custom table to populate zustomizer setting/control select options
- Move default page templates to sub directory
- Compare the old get_theme_mod($name) to the new get_theme_mod($name) return value
- Is it possible to visually group items on the theme customizer?
- Remove “You are using WordPress 3.2.1” from Right Now Dashboard Widget
- WooCommerce: multiple input field for multiple product variations
- Redirect to another page using contact form 7? [closed]
- Customizer – loading settings/controls/sections/panels based on a id/page id
- Integrate WooCommerce theme with a WordPress theme [closed]
- How do you use WordPress for a website that’s not in a blog format?
- Custom theme, contact form 7 & fast secure form doesn’t work
- Child Theme header1.php file not overwriting parent theme’s header1.php file
- Replace single_template filter with what for default posts?
- How to have content scroll over background
- Replace site title with logo when logo is uploaded in customizer using
- Is there a WordPress boolean for “theme_customizer_active()”?
- searchform.php doesn’t work properly
- Customizer: get_preview_url() inside customize_save_after hook
- How to add custom meta box when you have a custom page template file
- add shortcode support in customizer
- Right procedure when you develop a WP Website for a client
- New to WordPress – Read the Codex, Other Docs; Still Confused
- How to add custom page elements to the WYSIWYG editor?
- Update Specific Key Value in Complex `wp_options` object
- Add content after get_header
- How to add icon over specific thumb
- My contact form – I’ve changed the source code but the changes are not being applied
- How to custom category template based on category?
- How to use multiple check-box values to work in a function and insert values in database
- What is the best practice workflow for new website overhaul and keeping current SEO ranking? [closed]
- HTML TO WP Theme : Submenu goes down wp_nav_menu
- Add a customize control depending wich radio setting is checked
- Any way to permanently translate themes?
- How to share posts (and plugins) between existing site and new, separate dev/test installation?
- A Customizer checkbox control that sets the setting to “” or to “blank” and show() or hide() a color control
- Customizer API way function is_customize_preview() works only in main page?
- Support Multiple featured images
- WordPress 3.5 + Foundation 5 not working on IE9
- What hook to use for loading a custom class extension during Theme initialization?
- trying to figure out how to use more that one image upload in the same section in theme customizer
- WordPress causing all code to be displayed on line 1. Receiving multiple errors after cleaning cookies and cache
- loading custom.js file after jquery is loaded
- Permalinks problem with custom theme
- How can i move my product name & price from below thumbnail to be the rollover content in Avada & Woocommerce?
- How to split the site’s layout without damaging this layout? [closed]
- themeforce (happytables framework) implementation