• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Header and footer from CI + posts from WP

#1
[eluser]nextexile[/eluser]
I have a CI website with a blog in /blog/ subfolder. Right now, CI ignores the routing in blog directory, which is good, but I need to find a way to combine my CI header, footer and session with WP content.

Should I be doing this through a controller in CI or load portions of the template into WP?

#2
[eluser]skunkbad[/eluser]
I just query the WP database from a CI model. Easy to do...

#3
[eluser]nextexile[/eluser]
Ok, but in my /blog/ directory, WP is already doing the routing, how do I then set CI to override that?

I mean, I totally get the concept of querying directly from CI but right now I can't even override WP's routing in that directory.

#4
[eluser]skunkbad[/eluser]
I usually set up a subdomain for wordpress, amd leave all routing to CI. Do you need WP for anything else?

#5
[eluser]nextexile[/eluser]
No, I just want WP as a nice backend for people that will write content but theming would be cool to do with CI.

So, is there any way to stop WP's routing within /blog/ directory? I tried creating a controller and a view in CI but it seems like WP takes presedence and renders the pages in that directory.

Thinking about it now, could I just remove the index file in /blog/ directory? Would that be a way of stopping WP's routing?

#6
[eluser]pulsewax[/eluser]
Include the wp-blog-header.php to access all functions of wordpress .. http://ellislab.com/forums/viewthread/194429/#954349

#7
[eluser]nextexile[/eluser]
[quote author="pulsewax" date="1345506920"]Include the wp-blog-header.php to access all functions of wordpress .. http://ellislab.com/forums/viewthread/194429/#954349[/quote]

Thanks for the tip but right now the issue is not with accessing the data, but with actually seeing CI output in /blog/ because the only output comes from WP.

#8
[eluser]jamesduncan[/eluser]
[quote author="skunkbad" date="1345351466"]I just query the WP database from a CI model. Easy to do...[/quote]

Can you elaborate on this? As someone fairly new to this - it doesn't seem too easy!

Ideally - like this poster - Id' like to have editors using the WP admin to create content - then have a CI header using Ion Auth to handle user profiles etc etc

Right now, because of site_url not being namespaced, when I log users into CI via Ion Auth, I either lose access to WP-ADMIN (where editors will work) or lose a CI user's session when hitting the WP templates

http://ellislab.com/forums/viewthread/135576/#716047

This user had the same problem - can you outline your approach? Much appreciated for sure!

#9
[eluser]jamesduncan[/eluser]
So after struggling with this - I dont think its "do-able" in the largest sense of the term

You can do certain portions of it (ie: make the header look the same, etc etc) but if you happen to be using Ion Auth, all of the various handshakes out there seem to rely on site_url - and Ion Auth needs this (as far as I know) which causes a lot of problems for Wordpress


That being said you get the WP loop into CI by bootstrapping them together in the CodeIgniter powered parts of your web app by doing the following

http://www.bluelayermedia.com/wordpress-...ntegration


So in my case, Im trying to figure out how to just query the WP post database (and all 25 of my custom fields for each of our 15,000 posts) and basically replicate the features of WP's single.php in a CI view

But if you have any log in functionality in your CI app, it might blow out access to the WP-ADMIN depending on which login library you are using


Would love any more input on this as I'm pretty new at all of this (under a month lets say)


Cheers and hope this help


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2019 MyBB Group.