• Hi,
    i may be trying to run before i can walk here as a php novice but here’s what i’d like to do…
    I have a static website and want to add a blog style news section to one column on the front page which i’m currently updating within my wysiwyg editor and there’s no option to leave comments.
    I’ve installed wordpress no problem. I’ve also been through a tutorial mentioned in one of the threads that tells you how to add a loop from themes/classic/index.php within my ‘news’ div tags. and to add ‘<?php
    require(‘…/wordpress/wp-blog-header.php’);
    ?>’ to the top of my index page.
    i’ve added the php extension to my home page which lies in a subdirectory but when i go to view the page i get 2 warnings and 1 fatal error pointing to line 2 of the php line added to the top of my page…that the files cannot be found.
    i don’t know what i’m doing wrong….should this be straight forward? can anyone offer some help?

    thanks

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter janice171

    (@janice171)

    i’ve just got past this poit by making the path absolute, but now i get this messge:
    Fatal error: Call to undefined function: have_posts() in /mywebpage/directory/subdirectory/index.php on line 365

    this is what is one line 365:
    <?php if (have_posts()) : while (have_posts()) : the_post(); ?>

    …and also adding the php code has increased the size of the column and messed up the design…can this be sorted out anywhere?

    If the title of your topic is true (“integrating into HTML”!) than the method you are trying won’t work. The target file has to be a .php file, too.

    Thread Starter janice171

    (@janice171)

    hi, thanks for your reply.
    i have renamed the file to a php file….the site is basically a static site but i would like to add some dynamic content.
    the other threads that talk about this kind of integration all say to add
    <?php require(‘http://www.mywebsite.com/wordpress/wp-blog-header.php&#8217;); ?>
    to the top of whatever page you want to add the ‘loop’ to…which i’ve done, and everything looks well in the editor but not in the browser i just get the

    ‘fatal error call to undefined function: have_posts()
    etc…

    do you know what could be causing this? my index.php (with the news section where i’ve added the loop) is outside of the wordpress directory…does this matter?

    cheers

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘integrating in existing html page.’ is closed to new replies.