Welcome Guest, Not a member yet? Register   Sign In
mod_rewrite, index.php etc
#14

[eluser]andychurchill[/eluser]
I think I've actually discovered the cause.

I now have a blank project - copied all my controllers back over, css, imgs, js, etc, and the wordpress blog folder that sits under public_html. everything is working as expected. it was at this point that I then realised that I've actually modified the index.php file so that I could access blog posts in the codeigniter homepage view. See this thread for the inspiration for this: http://ellislab.com/forums/viewthread/48347/

What I'd done is added:

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

at the very top of the index.php page, just before the error reporting level is set. This enabled me to pull the most recent blog post details and display them in my home controller. query_posts is a WP function, basically hands over the functionality of reading from the DB back to WP.

$blog = query_posts(array('showposts' => 1));
$blogdata['blogTitle'] = $blog[0]->post_title;
$blogdata['blogExcerpt'] = $blog[0]->post_excerpt;
$blogdata['blogURL'] = $blog[0]->guid;

$this->load->view('home_view', $blogdata);

But I guess it's this that is causing the problem! I think this is the only reason I put that line in the index.php, so if I re-write this bit of code, perhaps to manually pull the content, (or perhaps see if someone already did a Wordpress Library for CI?) then it should achieve the same thing without needing the require_once line in the index.php!


Messages In This Thread
mod_rewrite, index.php etc - by El Forum - 01-19-2010, 05:37 PM
mod_rewrite, index.php etc - by El Forum - 01-19-2010, 06:21 PM
mod_rewrite, index.php etc - by El Forum - 01-19-2010, 07:12 PM
mod_rewrite, index.php etc - by El Forum - 01-19-2010, 07:35 PM
mod_rewrite, index.php etc - by El Forum - 01-19-2010, 07:41 PM
mod_rewrite, index.php etc - by El Forum - 01-19-2010, 07:48 PM
mod_rewrite, index.php etc - by El Forum - 01-20-2010, 04:44 PM
mod_rewrite, index.php etc - by El Forum - 01-20-2010, 05:02 PM
mod_rewrite, index.php etc - by El Forum - 01-20-2010, 05:29 PM
mod_rewrite, index.php etc - by El Forum - 01-20-2010, 05:46 PM
mod_rewrite, index.php etc - by El Forum - 01-20-2010, 06:31 PM
mod_rewrite, index.php etc - by El Forum - 01-20-2010, 06:51 PM
mod_rewrite, index.php etc - by El Forum - 01-20-2010, 07:05 PM
mod_rewrite, index.php etc - by El Forum - 01-20-2010, 07:28 PM
mod_rewrite, index.php etc - by El Forum - 01-20-2010, 09:42 PM



Theme © iAndrew 2016 - Forum software by © MyBB