[resolved] Theme/template use for this case? (3 posts)

  1. sepehr125
    Posted 6 years ago #

    Hello all,

    I want to have three or four pages on my site be word-press powered blogs. I won't be needing comments or anything; wordpress would just be a simple backend for my client. Currently, WP is installed in a directory in the site's root called wordpress. The other pages, which would be pulling posts based on category from the wordpress directory, are sibling directories to wordpress.
    I've been trying this method:

    In the main content div of x.com/news/blog.php, I have the following tentative code:

    <?php define('WP_USE_THEMES', false); get_header(); ?>

    $posts = get_posts('numberposts=10&order=ASC&orderby=post_title');
    foreach ($posts as $post) : start_wp(); ?>
    <?php the_date(); echo "
    "; ?>
    <?php the_title(); ?>
    <?php the_excerpt(); ?>

    but am receiving fatal error

    Fatal error: Call to undefined function get_header() in /home/mepkin/www/www/news/blog.php on line 58.

    How can I make the path to get_header work in this situation?

    Would other functions and The Loop work in this situation? Could I get a sidebar for, say, archives, pulled in for specific categories, etc. using the above method?

    If I use a theme that mimics my site's design and templates that pull the right data based on category, what would the URLs look like? Would they all be in the directory WordPress?

    Any and all advice would be much appreciated.



  2. Ben Sutcliffe
    Posted 6 years ago #

    Are you literally calling this script from the web address x.com/news/blog.php?

  3. sepehr125
    Posted 6 years ago #

    Hey bsutcliffe,

    Nah, x.com was taken. ;) Just using it as an example.

    The script is being called from:

    WordPress is installed in

    Did this address your question?



Topic Closed

This topic has been closed to new replies.

About this Topic