WordPress.org

Ready to get started?Download WordPress

Forums

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

  1. sepehr125
    Member
    Posted 5 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(); ?>

    <?php
    $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(); ?>
    <?php
    endforeach;
    ?>

    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.

    Thanks

    Sepehr

  2. Ben Sutcliffe
    Member
    Posted 5 years ago #

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

  3. sepehr125
    Member
    Posted 5 years ago #

    Hey bsutcliffe,

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

    The script is being called from:
    http://example.com/news/blog.php

    WordPress is installed in
    http://example.com/wordpress

    Did this address your question?

    Thanks,

    Sepehr

Topic Closed

This topic has been closed to new replies.

About this Topic