Embeding Wordpress in PHP template site

Discussion in 'PHP' started by joliett89, Feb 9, 2012.

  1. #1
    I have a simple site (header.php, footer.php and some content sites in between) and I want to include Wordpress as one of them. I install it and it works as domainname.com/blog, but I am wondering if I can get it to work under regular header.php, just like with other pages (Home, Services, Resources, Blog, Contact). I am using something like this:

    <?php
    $subtitle = "Media Services";
    include("header.php");
    ?>

    When I add the following code, it does not load anything,

    include("blog/wp-blog-header.php");

    but a test file like test.php (with echo "This is test etc..") works with the same pathname.

    Does anybody know what am I doing wrong. I basically want to have blog under the header here http://67.23.244.109/~belerose/blog.php instead of http://67.23.244.109/~belerose/blog

    Thank you.
     
    joliett89, Feb 9, 2012 IP
  2. awood969

    awood969 Member

    Messages:
    186
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    40
    #2
    I have never tried to do it before however I would try using require_once instead of include and give it another go. Include simply tries and moves on however require forces the script to include the code or die();. The importance of this is that you'll get a (hopefully) detailed error message which will give you further instruction.

    Thanks
    Andrew
     
    awood969, Feb 9, 2012 IP
  3. joliett89

    joliett89 Active Member

    Messages:
    124
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    53
    #3
    I've been trying to figure it out for a while and the best way to do this is just to make the Wordpress page look like the rest of the website, rather than the other way around. I never used Wordpress before, but I was looking at the admin are and there is quite a lot of code in css Editor and that probably depends on the theme also. I am looking at something like Blank / Naked themes for Wordpress, so it is easier to make it look like the original website. It does not have to be difficult, it looks like, but I need to figure out the best way to do that etc (find some light version instead of entire Wordpress installation or something like that, and still be able to expand later)
     
    joliett89, Feb 9, 2012 IP
  4. awood969

    awood969 Member

    Messages:
    186
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    40
    #4
    If your uneasy doing it yourself just post a job in the services section of the forums here at DP. Somebody will do a conversion between native <--> Wordpress for about $20-40 its not very expensive.

    Thanks
    Andrew
     
    awood969, Feb 9, 2012 IP
  5. joliett89

    joliett89 Active Member

    Messages:
    124
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    53
    #5
    I want to learn how to do it myself. I am gonna be using Wordpress a lot.
     
    joliett89, Feb 9, 2012 IP