• Hi all,

    Im trying to display some content from wordpress outside its folder using the following code:

    <?php
    ini_set('display_errors',1);
    error_reporting(E_ALL|E_STRICT);
      // Include WordPress
      define('WP_USE_THEMES', false);
      require('./guides/wp-blog-header.php');
      query_posts('showposts=1');
    ?>
    <div id="content" class="guides">
    	<div id="contentLeft">
     <?php while (have_posts()): the_post(); ?>
    <h2><?php the_title(); ?></h2>
    <?php the_excerpt(); ?>
    <p><a href="<?php the_permalink(); ?>">Read more...</a></p>
    <?php endwhile; ?>

    Trouble is when loading the page I get the following error:

    Fatal error: Call to undefined method stdClass::set_prefix() in /html/guides/wp-settings.php on line 268

    I have been able to isolate the cause of this problem which is my roots htaccess file which looks like:

    Options -Indexes
    AddHandler php5-script .php
    
    RewriteEngine on
    
    #RewriteBase /ssa
    
    RewriteCond %{REQUEST_FILENAME}       !-d
    RewriteCond %{REQUEST_FILENAME}       !-f
    RewriteRule ^(.*)$   index.php?uri=$1 [NS,L,PT,QSA]

    Now im not very familiar with htaccess but I dont understand why its breaking displaying wp content outside its folder?

    Can anyone provide me a solution to get this to work? Thanks

  • The topic ‘stdClass::set_prefix() Error’ is closed to new replies.