When enhancing WordPress functionality, always use the theme’s functions.php
file (located, generally, in {WP root}/wp-content/themes/{your theme}/functions.php
), or put your code into a plugin.
The rules for hacking core code are similar to the rules for optimization.
- Don’t do it.
- (for experts only) Don’t do it yet.
Related Posts:
- Check if row exists before inserting
- How can I connect to a second database and still be able to use wp functions like get_post_types()?
- Writing a function for WP Cron to run a SQL command daily
- Most efficient way to get custom database records from 20 buttons and 20 tables?
- How to update BuddyPress xprofile fields programmatically? [closed]
- Best Practice for Syncing Local Development With Staging Development [closed]
- Is it good practice to use wpdb->query() function?
- Remove the deleted users avatar from list
- when I fetch data from remote mysql database in wordpress built in wordpress function is not working?
- WordPress shortcode attributes for database SELECT?
- Trying to establish connection to External Database
- How to insert a single row to WP database table?
- Which action does wp_update_user triggers?
- Wp_query function to search from product_title ‘OR’ product tags name
- Updating Media Published Date When Parent Post Is Modified in WordPress
- Is there a WP function to get taxonomy name from taxonomy_term_id?
- Get User Login Data (date, time… )
- Multisite 404 on pages – rewrite error breaks database
- Connecting to a 2nd DB gives me no results when querying
- Is There Any Built In WP Functionality For Combining Form Fields To Return Specific Data
- Check if a value exists in database table
- wp_usermeta – Read from database, but save function broken
- Get the alphabetical sorted data with wpdb
- How to loop while adding data to database?
- Update wp_postmeta table based on 2 keys
- sort title descending with title with number
- Delete oldest wordpress post (SQL query)
- Button click counter for login user
- Function stops working
- What to do to have access to WordPress functions
- Database SQL Error, Should Work
- Database Query not working
- Function returning queried meta value based on current post ID
- How to add next height number in Order Attributes inside the Add new page. [duplicate]
- Function to get the name in database table from the comma separated string
- Functions file mods and CPU
- Bulk set Post Title as Tag where Tag is Empty Function
- WPDB query suddenly not working
- How to trigger an update_option
- Function wpdb::prepare was called incorrectly. The query argument of wpdb::prepare() must have a placeholder
- Outputting query results
- Remove a Plugin function through theme’s function.php?
- Insert a field with PREG_REPLACE – strange behaviour
- Child theme functions.php
- WordPress Website with Login system
- Function to pull data from user meta not working
- Fill empty custom field with other custom field
- How to echo Widget Title in Custom Frontend-Template Box
- Add a class to post if it has been recently updated
- Redirect to post after publish or update a published post
- Return link pages instead of displaying them
- Difference between get_userdata() and get_currentuserinfo()
- Adding Read More to Custom excerpts
- Page Template Won’t Load Correct CSS File
- Replace admin header logo with an image
- wp_get_attachment_image_src returns image on main domain, false on subdomain
- Call two different function.js depending on page
- Display a random tag but using cron to control frequency of change
- contact form in template with jquery,validate and ajax
- How to print the current post depth as update notification?
- Changing the header image using WPML
- How to safely edit functions.php
- New checkbox in custom widget isn’t saving data
- Linking Javascript in functions.php file
- the_widget() inside functions.php
- Entirely Different Functions.php per Page?
- current_page_item is missing inside wp_nav_menu
- how to display a page before the home page
- Change default upload images size for contributors
- How to access the WordPress DB from a plugin file
- Strange error from functions.php files (wp_register_script)
- search form leads to 404
- Dequeue scripts in IE7 only using functions.php
- loginout function customization
- Add row to custom database Table and delete all rows older than 1 day
- Why a SlideShow (made using JQuery FlexSlider) can’t work if I load it form functions.php but work if I load it from my footer.php file? [closed]
- Why I can’t load my JavaScripts using an hook inside my functions.php file?
- Retrieve First Image Function
- Unable to add extra elements to the main navi (wp_nav_menu_items)
- User meta and public function security
- Internet Explorer opens links to .msi files as text in a new tab
- Breaking up multiple words and inserting an image after first word
- call wp_insert_user in custom class doesnt work
- functions.php return custom text
- How do I preserve changes to a theme’s functions.php across updates?
- access JSON results from wordpress database with wpdb
- get content from page through AJAX
- Creating multiple category drop down
- Disable trim in WordPress
- Show Featured Image in else statement
- Show admin page, only if function is being used
- WordPress database error You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version [closed]
- Custom Image Size in Insert Media
- Function to echo (or display?) wordpress tags in the head section
- is_home() not working in functions.php file
- Get users with different roles and call function on each of them (user_meta)
- Limit number of characters in different excerpts
- Custom function for search form
- Filepath to Chosen for “Home Page” option – Which function?
- If no author posts, echo out some text