Forums

how to link to wordpress powered page (11 posts)

  1. wazzaday
    Member
    Posted 11 months ago #

    hi
    so i have a word press page coming along and i wish to link it to my home page which is not powered by word press. i have a section there titles recent blog posts, i want my most recent post to show in this section, how would i go about doing this?

    thanks in advance guys!

  2. esmi
    Theme Diva & Forum Moderator
    Posted 11 months ago #

  3. wazzaday
    Member
    Posted 11 months ago #

    thanks for that,i still have a problem then, iv rad through it all and added the php code mentioned to use wordpress features

    <?php
    /* Short and sweet */
    define('WP_USE_THEMES', false);
    require('/....../header.php');
    ?>

    and i receive the following error when i load the page:

    Server error
    The website encountered an error while retrieving http://www.pixel-void.com/homee.php. It may be down for maintenance or configured incorrectly.

  4. Rev. Voodoo
    Volunteer Moderator
    Posted 11 months ago #

    require('/....../header.php');

    this line is definitely wrong

    notice in the example it shows

    require('./wp-blog-header.php');

    so it links to the wrong file, and

    /....../

    is also not going to work.... how many directories are you trying to navigate?

  5. wazzaday
    Member
    Posted 11 months ago #

    that was just an example, i checked the directories and tried that aswell.

    im going through /wp-blog-header.php

    sorry if im being a noob, started wordpress from scratch last week

  6. Rev. Voodoo
    Volunteer Moderator
    Posted 11 months ago #

    you don't link to

    /blog/wp-content/themes/twentyten/header.php

    you just link to wp-blog-header.php

    it's a core file which resides in the WordPress root directory, looks like that is blog on your install

  7. Rev. Voodoo
    Volunteer Moderator
    Posted 11 months ago #

    http://www.corvidworks.com/articles/wordpress-content-on-other-pages

    here's another article, the one I used when I linked my non WP site

  8. wazzaday
    Member
    Posted 11 months ago #

    ok thanks ill get to it!

  9. wazzaday
    Member
    Posted 11 months ago #

    ok i tried that, i installed wordpress in the directory 'blog'.

    <?php
    // Include WordPress
    define('WP_USE_THEMES', false);
    require('./blog/wp-load.php');
    query_posts('showposts=1');
    ?>

    throws up the same error

    i have one file in my main directory called header.php and all the other pages include that. just in case that may be the cause of the problem.

  10. wazzaday
    Member
    Posted 11 months ago #

    ok sorted now. i had the first part of the code in the header file and the second in the page i wanted to display the post, as the header is included in that page i figured it would work, but it wouldnt.

  11. Rev. Voodoo
    Volunteer Moderator
    Posted 11 months ago #

    Glad you got it sorted. Seems including WP can be a bit flaky. I had the header code on my non WP page at the very top, and the page would not load, just a blank page. Moved it down just above the </head> tag and everything worked.

Reply

You must log in to post.

About this Topic

Tags