[1.5] Integrating WordPress into existing PHP site
-
Hey guys!
I’ve decided to give WordPress a go and I’m working on integrating it into a client’s website. I don’t want all the fancy features, just the plain simple blog entries to show up within the site I’ve built.
I followed the tutorial at:
https://www.chrisjdavis.org/2004/05/07/adding-wordpress-to-an-existing-site/1/
..and after all that, wound up with a bunch of parse errors. A friend of mine had a look at the code and said it was really messy, opening and closing way too much. I was wondering if maybe the code wasn’t built to work on 1.5?
Anyway, any thoughts or suggestions would be greatly appreciated. I’m really looking forward to moving ahead with this!
Thankyou all in advance, you guys have built a great piece of software here and I’m looking forward to supporting you :).
-Jonathan Wold
-
Hmm, yeah, I should’ve probably suggested what you did.
But, if he already managed to include
wp-blog-header.php
, why the functionget_header()
can’t be found?
Well, I’d never know unless I’m doing it myself, I guess.Well, I just tested myself.
/blog.php
in document root
/wordpress/
is where WP is installedThe content of blog.php is the following
<?php
include( "wordpress/wp-blog-header.php" );
get_header();
?>Load
blog.php
and I do get the header of the currently active theme.OK guys, we’re getting close!
If you go to https://www.amaezing.net/blog you can see that its working nicely.
If you go to:
https://www.amaezing.net/blog.php which the site where I am actually wanting the blog to integrate with, you can see that its messed up. Its DOING something finally but its pulling the whole site in and its forgetting the text. I’m using the following in blog.php:
<?php
include( “blog/wp-blog-header.php” );
get_header();
?><?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
<?php endwhile; else: ?>
<?php _e(‘Sorry, no posts matched your criteria.’); ?>
<?php endif; ?>… Any suggestions? I’m REALLY looking forward to getting this working :). Remember, my goal is to simply get the blog posts to show STRAIGHT as text into my content.. Thanks a ton guys!
-Jonathan
..Any new ideas guys? I’ve been working on this and still nothing ??
I’m just jumping into this, but did you check to make sure that all the database names match the names required for WordPress to function? Did you export the whole original database and then import it into WordPress? There might be a small problem within the database.
Honestly, there are two issues here. One, with the new release of 1.5, everyone on the forum and among the support crew are working their tails off dealing with their own upgrades and learning curves, and answering all the questions. So have patience. I know it’s difficult. I’ve been working on my own transfer from a static HTML site to 1.5 for three months now and it isn’t easy – nor ready to release to the public. Of course, it isn’t the only thing I’m working on…
The second issue may help you more than my excuses. Check your import method and start clean with that. Get rid of EVERYTHING you’ve installed with WordPress and clean it all out. Start with a brand new download of 1.5. (It still isn’t “completed” so they are posting new files when things are fixed – get the newest.) Do a clean install and make sure the install is working fine with nothing in the database (create a new database set of tables for this install to keep everything totally clean).
Once the install is running, with no posts and nothing but the test data in the database, select your theme and do a little tweaking on the test post if you want, but keep it clean and simple, no changing of code. Or leave it alone as it is. I recommend you choose Kubrick (default) at the best or Classic at the least until you get things figured out.
Once you are happy with the functions as it is, then import your old data to the new database and see if that works for you. I recommend, if you can, importing only 50 or so posts at a time if you have to mess with your import to make it look “right” for the import style you are choosing (if not from one of the import-functions already available). If these 50 or less still don’t work, you haven’t wasted a lot of time or bandwidth and we can help you further.
Do this slowly, step by step, and see if you still have any problems from there. Somewhere in the process a step is being missed or crossed. Take lots of notes. You might find out it is something simple.
Once you get your posts in, THEN start screwing with the layout and presentation and messing with the codes.
I hope this helps.
Okay, so what you want is to have the page at https://www.amaezing.net/blog.php show JUST the blog posts as they occur and update, within the “framed” area on that page, right?
IF that’s the case, then check out Feedread from ChaitGear: https://www.chait.net/index.php?p=238 (one part of the larger package).
Caveat: I originally used this with a 1.2.2 Fantastico install of wp. I’ve since upgraded to a manual install of 1.5, and Feedread is still working just fine.
Thanks so much for the replies guys! Thanks for the lengthy reply Lorelle! ?? – Very informative and in my case, this isn’t a transfer but a clean install.
I’ll check out the Feedread link and let you guys know how it goes.. and again, thanks so much!
-Jonathan
Well, the loop is already going, you just need to decide what to display. Refer to documentation.
<?php
include( "blog/wp-blog-header.php" );
get_header();
?><?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
<?php the_title(); // display the content?>
<?php endwhile; else: ?>
<?php _e('Sorry, no posts matched your criteria.'); ?>
<?php endif; ?>I just looked at the link you gave, and it looks like it is basically working. Either you are using Pages or good Permalinks, so while the entry page isn’t showing any text, the categories at the top are working fine.
The text does run off at the bottom over the end “bar” and keeps on going, but this is because the CSS is FIXED instead of relative, stretching with the length of the post entry. That is a CSS fix and not a WordPress function fix.
As to why things aren’t showing up on the front, it is showing up on index.php but not on blog.php. I don’t know what is supposed to be on blog.php. I checked the source code and it says you are trying to make Kubrick work for you, but there are some size problems with the graphics (he has some strange stuff going with the graphics that I blew out in my design).
It also lists this for “content”:
<!-- Begin RIGHT -->
<div id="right">
<!-- Begin main content -->
<div class="prop minheight" id="right_content">
</div>
<!-- End main content -->The content isn’t being pulled in at all. Maybe with this info someone else can help you more specifically. I’d check to see what is between the
<div class="prop...
and the end of the main content cuz this is part of your problem there.And don’t forget, even the cleanest installs can get screwed up by us innocent humans poking around……good luck with it.
Hey Lorelle!
Thanks for the additional help :).
Basically, what I have is a totally clean webpage that I’ve built from the ground up. Index.php is what I’ve built, so is blog.php.
What I wanted to do, was provide a way to create blog entries in an easy fashion, WYSIWYG and all the works, and then have that content put directly into the website.
So.. I installed wordpress into the /blog folder (https://www.amaezing.net/blog) and as you can see, that’s working great.
So now, I want to take the feed from there and integrate it directly into the site.
So, I took the blog.php page and put the following code:
<!– Begin main content –>
<div class=”prop minheight” id=”right_content”>
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
<?php endwhile; else: ?>
<?php _e(‘Sorry, no posts matched your criteria.’); ?>
<?php endif; ?></div>
<!– End main content –>..That obviously didn’t work ;). See.. I’m simply trying to get the blog feed to show up inside the “Main Content” divs.
As for the reason the page is all messed up.. I have this piece of code at the top which is attempting to pull in the blog header:
<?php
include( “blog/wp-blog-header.php” );
get_header();
?>..Its obviously working, and the default theme is conflicting with mine :).
So, it boils down to, I’m simply trying to figure out how to get the contents of the blog to show up, as they’re updated, into the website.
I’m looking into the links you guys mentioned right now.. this is confusing stuff but I’ll get it! Thanks SOO much for all your help! Any and all suggestions are very welcomed.
-Jonathan
..any new ideas? Once I figure this out I plan to write a guide on it :). So far the best I’ve got is to integrate an RSS feed using zfeeder.. anything better?
-Jonathan
sirjonathan,
Actually the answer for you question is here above, you just have to follow the instructions there. Honestly, it is not that difficult, I have tried ??
So, here is what I did:
1. After the install I copied theclassic
folder (since that’s the simplest theme) once again in the theme directory and renamed itmystyle
.
2. Opened the header, footer and (eventually) index.php files and edited them to fit in the site’s general design.
2a. Obviously the action above involves some tweaking in the style.css file, too. (Basically combining the main things from your own stylesheet and the theme’s stylesheet.)
3. When done, in the WP admin panel selectedmystyle
as the active theme.
4. One level above the install (root?) in the blog.php (or whatever.php) put the lines suggested by alphaoid… It works with the whole loop, too.Edit. P.S. If you do not want the Comments link or anything else to appear on the blog.php just delete/edit them out from the loop.
Did you read my last post before this? Did it not give what you wanted? Or something did not work?
I’ll be giving this another try later on this morning after I get some sleep :). If anyone has any updates on getting this to work, let me know! I’ll be posting my results!
-Jonathan
- The topic ‘[1.5] Integrating WordPress into existing PHP site’ is closed to new replies.