WordPress.org

Ready to get started?Download WordPress

Forums

new pages? (22 posts)

  1. tosk
    Member
    Posted 9 years ago #

    hi can any 1 help me i want o make a new page for my blog, and link it to the side bar page, thx for any help

    ive tryed making a new page calling it mmorpgs.php and adding <?php get_header(); ?> and the rest to show the template i use but all i get is atal error: Call to undefined function: get_header() in /home/tosk069/public_html/blog/wp-content/themes/tosk/mmorpgs.php on line 7

    i just know aht im doing wrong :/

  2. tosk
    Member
    Posted 9 years ago #


  3. Michael Bishop

    Posted 9 years ago #

    Are you also including the path the to the file?
    <?php
    require('wordpress/wp-blog-header.php');
    ?>
    where the "wordpress" is the name of the directory that you have wordpress installed.

  4. tosk
    Member
    Posted 9 years ago #

    that dont work to :/

  5. tosk
    Member
    Posted 9 years ago #

    can the page be viewed direct from the folder where its in? like

    http://www.mysite.com/blog/template/mypage.php ?

  6. Michael Bishop

    Posted 9 years ago #

    You say, "that dont work to", but did you use that in conjunction with the <?php get_header(); ?>? And did you change "wordpress" to "blog", as I see your directory is called?

    Also, why not just create a new Page in the Write -->Page feature built into WP?

  7. tosk
    Member
    Posted 9 years ago #

    hi yea i changed the wordpress to blog, and for making pages from the page thing i know i can do that but i dont want the data to be stored in the mysql db, i want to make a new page and set the template into it and add the content with in it and link the page to the sidebar

  8. tosk
    Member
    Posted 9 years ago #

    i see that u have done it with ur blog nice :) ur pages made with that page thing ? or r they page files?

  9. corefx
    Member
    Posted 9 years ago #

    have you tried creating a page in the admin, and then just php including what you wanted into the page?

  10. tosk
    Member
    Posted 9 years ago #

    hi corefx, i dont want to make the pages that way, i want to make them as a php file and link the templates headers and footer then set them in the sidebar page

    ive made my mmorpgs page that way but i want to make it as a self php file so i dont have data saved into the mysql db

  11. Michael Bishop

    Posted 9 years ago #

    All of my pages were created with the page feature, some use a plugin to allow php directly in the page.

    IF you don't want to use the page feature then <?php
    require('blog/wp-blog-header.php');
    ?>

    <?php wp_head(); ?>
    Should work to allow WP functions to be called in the page.
    To link to it, you are going to have to hard code the link to the new page, as it lies outside WP, and wouldn't be able to be called in a function like wp_list_pages.

  12. tosk
    Member
    Posted 9 years ago #

    yea im trying to hardcode it now but having no luck :/

  13. Michael Bishop

    Posted 9 years ago #

    What code are you using?

  14. tosk
    Member
    Posted 9 years ago #

    ive tryed
    <?php include (TEMPLATEPATH . 'blog/header.php'); ?>

    <? include("blog/header.php") ?>

    and
    <?php require('blog/wp-blog-header.php'); ?>

    with the full psth to the files to and no luck here is the page im trying to make

    http://www.tosk.co.uk/blog/wp-content/themes/tosk/mmorpgs.php

  15. tosk
    Member
    Posted 9 years ago #

    here is the code to the page

    http://nopaste.php-q.net/149481

  16. Michael Bishop

    Posted 9 years ago #

    After you put the php require, are you still using the <?php wp_head(); ?>

    You need both.

  17. Michael Bishop

    Posted 9 years ago #

    Ok. You need to put those functions within the <head></head> of the html document.
    Then call your other functions.
    http://nopaste.php-q.net/149482
    EDIT
    http://nopaste.php-q.net/149484
    to reflect both codes combined.
    But why again don't you want the page done in pages?

  18. tosk
    Member
    Posted 9 years ago #

    still no luck :/

    yea i want the page to be a file.php not made by the script

  19. Michael Bishop

    Posted 9 years ago #

    The problem is you are putting the file in your themes folder. I just realized that. Move file to your "blog" directory. You probably can drop the php require, as it's in the same directory. You may just want the <?php require('wp-blog-header.php'); ?>

  20. tosk
    Member
    Posted 9 years ago #

    weeeeee hehehe i did it thx alot m8, i o u 1 :p

    i added <?php require('wp-blog-header.php'); ?> with the path to the blog folder sweet :)

  21. tosk
    Member
    Posted 9 years ago #

    i just gotta get the info in the right place now on the page o.O

    any idea on how i can get the info move across the page? ive tryed tables that didnt work

    http://www.tosk.co.uk/blog/wp-content/themes/tosk/mmorpgs.php

  22. tosk
    Member
    Posted 9 years ago #

    its ok now ive fixed that prob cya guys thx again :)

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.