Support » Themes and Templates » Including searchforum.php

  • I’m reading the tutorial on about theme design, and tbh starting to regret it, most of his examples are incorrect. I’ve managed to correct most of his code apart from this.

    <?php include(TEMPLATEPATH . ‘/searchform.php’); ?>

    For some reason, TEMPLATEPATH returns

    God knows why, maybe its a design flaw.

    I’ve been trying to put <?php bloginfo(‘template_directory’); ?> inside the include, and asked on the IRC channel for the past few days now, this is getting frustrating 🙁

Viewing 5 replies - 1 through 5 (of 5 total)
  • Don’t know about your TEMPLATEPATH issues, but <?php bloginfo('template_directory'); ?> should be <?php get_bloginfo('template_directory'); ?> if it’s inside an include().

    <?php include (<?php get_bloginfo(‘template_directory’); ?>); ?>

    Parse error: syntax error, unexpected ‘<‘ in C:\xampp\htdocs\wordpress\wp-content\themes\PimpinYourPCRed\index.php on line 55

    Also tried

    <?php include(<?php get_bloginfo(‘template_directory’); ?> . ‘/searchform.php’); ?>

    Nope, that doesn’t seem to fix it either. 🙁

    I don’t say this to be rude, but sincerely: If you plan to tinker much with WP’s code, you may want to google for an introductory PHP tutorial just so you are familiar with the syntax.

    <?php include ( get_bloginfo('template_directory') ); ?>

    Thanks, your probably right. I am trying to dive into it way too fast than usual. But thats how i learn things 😀

    I learned to swim like that too, i jumped in at the deep end…i didn’t drown though 😀

    WP is great code for learning. I didn’t know much PHP when I started, but between tinkering with themes, spending lots of time at and, and eventually writing a few plugins, I got pretty handy at the code stuff, so enjoy.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Including searchforum.php’ is closed to new replies.