Important WordPress theme functions every developer needs

When we develop any custom WordPress theme we need to use different functions. We need to write those functions in functions.php file of the custom theme. I have prepared some of those basic functions and included in the functions.php file. I have mentioned the usage / procedure to use the function in the same file.

You have to download the functions.php file and put it inside your theme folder.

Following functions are included in functions.php file.

  1. Navigation / Menu
  2. Remove default UL markup from wp_nav_menu output
  3. Enable featured image with custom dimension
  4. Image compression while uploading
  5. Remove width and height attributes from inserted images
  6. Enable sidebar widget
  7. Shorten post / page title by word limit
  8. Shorten excerpt by word limit
  9. Shorten content by word limit
  10. Strip images from content
  11. Display the content of a page by page ID
  12. Display the content of a page by page slug
  13. Anti spam email shortcode inside content editor
  14. Change default sender email address for generated emails
  15. Change default sender name for generated emails
  16. Remove default widgets
  17. Remove WordPress version from Head
  18. Remove login error message on login page
  19. Enqueue script in footer
  20. Enqueue CSS in header
  21. Disable admin bar for all users but admins in the front end

GitHub URL: https://github.com/sanjaybhowmick/wp-useful-functions


Do you need a WordPress developer? Please contact us.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.