Support » Fixing WordPress » Adding functions for new php file

  • Resolved pubsforplebs

    (@pubsforplebs)


    After re-pasting the html over and over for a column on the left side of my page, I realized I could probably save myself a lot of hassle by putting the code into a php file and just calling the file each time, allowing me to make any changes to one file instead of hunting down each occurrence. I essentially took the Sidebar php file, renamed it (inside and out), and put the new html in there. I tested it on a page called 99archive, but when I call it, I get this error:

    Fatal error: Call to undefined function get_leftcolumn() in /home1/pubsforp/public_html/wp-content/themes/twentyten/99archive.php on line 25.

    I’m guessing I need to alter something in the functions.php file, but that’s something I’ve never messed with before. Can anyone clue me in as to what I’ll need to put in there to simply get this leftcolumn.php to appear properly?

    Thanks!

Viewing 1 replies (of 1 total)
  • You can call template files using the following:

    <?php include(TEMPLATEPATH . '/99archive.php'); ?>

    or custom sidebar:

    <?php include ('sidebar_99archive.php'); ?>

Viewing 1 replies (of 1 total)
  • The topic ‘Adding functions for new php file’ is closed to new replies.