WordPress Adding PHP when writing.

Discussion in 'HTML & Website Design' started by Vizuke, Aug 30, 2006.

  1. #1
    I don't know if there is a way to add php codes inline when writing a post, or a page (within WordPress). If anybody knows, it would be helpful because I am trying to create a webpage (let's say a list of members), and add all the default templates file in it (header, sidebar, footer). I can do it manually but when I view it, the get_header() function shows up an error and the page won't load.

    Example: This is the page http://www.vizuke.com/dblgve/players_list.php (page's offline, isn't viewable at the moment)

    <?php get_header(); ?>
    
    	<div id="content" class="narrowcolumn">
    
        		hello
    
    	</div>
    
    <?php get_sidebar(); ?>
    
    <?php get_footer(); ?>
    Code (markup):

     
    Vizuke, Aug 30, 2006 IP
  2. Mind_nl

    Mind_nl Peon

    Messages:
    95
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #2
    have you also added
    define('WP_USE_THEMES', true);
    require('./wp-blog-header.php');
    Code (markup):
    to your page? What is the error you are getting from your page?
     
    Mind_nl, Aug 30, 2006 IP
  3. Vizuke

    Vizuke Peon

    Messages:
    339
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Ok, I have added those two lines before calling all the get functions and this is what it displays.


    Warning: main(./wp-blog-header.php): failed to open stream: No such file or directory in /home/vizuke/public_html/dblgve/players_list.php on line 4

    Fatal error: main(): Failed opening required './wp-blog-header.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/vizuke/public_html/dblgve/players_list.php on line 4
     
    Vizuke, Aug 30, 2006 IP
  4. MarRome

    MarRome Peon

    Messages:
    865
    Likes Received:
    92
    Best Answers:
    0
    Trophy Points:
    0
    #4
    MarRome, Aug 30, 2006 IP