简体   繁体   中英

Integrating WordPress with a website, generically

So, I've read The Loop and I got the hang of it. (I created a page that lists the 3 most recent posts, a page that shows a page (as opposed to a post), and so on.)

However, it seems silly that, in order to integrate a WordPress blog into an existing site, I'd have to replicate all the different kinds of pages (lists of posts, the posts themselves, pages, etc.)

Is there a generic way of doing this?


The full idea is something like this.

Now, in my PHP code at http://example.com/blog , I want to do something like this:

query_posts($_GET);

// display results

wp_reset_query();

That's where I'm stuck. Basically, I want to display exactly what's in the "content" area of a default WordPress template, on my site, according to whatever the query string dictates. Almost as if I were just using an iframe . I would rather not have to parse the query string to figure out whether I have to loop through this or that or turn off the $more global or not, etc.

What am I missing?

Instead, should I be installing the blog at http://example.com/blog and creating a template that mimics the website? This seemed complicated so I didn't go this route, but maybe someone should change my mind.

Appreciate any help, including advice for alternative designs.

您是否考虑过将博客输出为完整的rss /将博客输出为json,然后以这种方式进行提取?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM