WordPress.org

Forums

Creating a custom function? (2 posts)

  1. willy
    Member
    Posted 7 years ago #

    I'm converting an existing php page to a wordpress page. On the existing page, I have 2 units of dynamic html based on the values of a cookie. I have existing code that can open / process this.

    My question: What is the proper way to integrate custom code into a WP template. Do i need to make a function call for it within the worpdress umbrella, or can I just type my php code in the template?

    Thanks & happy new year!

  2. Kafkaesqui

    Posted 7 years ago #

    If using WordPress 2.0 and you prefer to separate code from design in your templates, you can add a functions.php file to your theme and place any custom PHP functions in there. WordPress will include the file automatically.

    But hey, it's your site, your WordPress. If the code is only to be used within the confines of your blog, do it however works best for you.

Topic Closed

This topic has been closed to new replies.

About this Topic