Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

WordPress

Wordpress integration into custom site

Ok so this is the thing. I am working on a project and everything is custom built to suit the client needs. How ever they have a blog that I want to feed to the home page (I have the include wp_head.php) and show at most 5 posts. Now what I want also is the show the recent posts in the sidebar with the tags etc... Also when the user click the link of the blog title I want the blog to load in the custom site and not have to redirect to the blog site itself.. A little help please.. Thanks everyone who contributes

Andrew Shook
Andrew Shook
31,709 Points

You might want to tag Zac Gordon, for something like this. Maybe he can point you in the right direction.

2 Answers

Andrew McCormick
Andrew McCormick
17,730 Points

check this out if you haven't already codex Integrating_Wordpress_with_Your_Website
also this discussion http://wordpress.org/support/topic/how-to-integrate-wordpress-with-existing-website
Also a step by step to the whole process: http://rivergraphics.net/resources-tutorials/how-to-integrate-a-wordpress-blog-into-an-existing-website/

The key is going to be not to over think it. I would literally draw it out and plan out what parts on your different page views are going to be coming from either the current site or feed by wordpress. I think once you have it all laid out, you'll have a better idea.

thanks for that info

Zac Gordon
STAFF
Zac Gordon
Treehouse Guest Teacher

So you have a WordPress blogged installed somewhere and you're dynamically pulling in the content to display it on this custom site, right?

The easiest way to do this would be to use AJAX to pull in either the list of latest posts or the content itself. You could make a really stripped down WP theme that just had a few pages that echoed out the info you want to display on your custom site. Then you would essentially use AJAX to pull it in as needed.

Is it a nasty solution? Yup. Would it work based on my understanding of the problem? I think so.

Let me know if I'm not understanding things correctly.

I will not say that you did not understand....but I think that will help.. So basically I have a site with its own custom sidebar... I want to show in my custom sidebar the recent comments and tags from WP...... I want to display at min 5 blog post on the home page of the custom site but I do not want the user to be directed to a separate site (tab) to see the post... So I think what am saying is that I want to make the single page part of the custom site....

Zac Gordon
Zac Gordon
Treehouse Guest Teacher

Gotcha, (I think)

Yeah, without using iframes or AJAX I'm not sure how else to best do this.