WordPress.org

Ready to get started?Download WordPress

Forums

Including searchforum.php (6 posts)

  1. CShadowRun
    Member
    Posted 6 years ago #

    I'm reading the tutorial on http://www.wpdesigner.com 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
    C:\xampp\htdocs\wordpress/wp-content/themes/PimpinYourPCRed

    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 :(

  2. Adam Brown
    Member
    Posted 6 years ago #

    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().

  3. CShadowRun
    Member
    Posted 6 years ago #

    <?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. :(

  4. Adam Brown
    Member
    Posted 6 years ago #

    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') ); ?>
  5. CShadowRun
    Member
    Posted 6 years ago #

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

    I learned to swim like that too, i jumped in at the deep end...i didn't drown though :D

  6. Adam Brown
    Member
    Posted 6 years ago #

    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 php.net and codex.wordpress.org, and eventually writing a few plugins, I got pretty handy at the code stuff, so enjoy.

Topic Closed

This topic has been closed to new replies.

About this Topic