• Hi, good morning, well, this is my first post, I have a question, I did a website with PHP and MySQL, later, my client installed a version of WP on a sub folder, like, domain.com/Blog he’s asking me to, using some kind of data, place the first 3 or 4 entries in the PHP website and then the link to the Blog, how can I achieve this? is there a way that I can use some kind os sepacial Wp tags that I can place in the index page on the PHP site and then, share the data? any idea? any help?

    Thanks so much!

    Arturo

Viewing 7 replies - 1 through 7 (of 7 total)
  • Thread Starter arturocivit

    (@arturocivit)

    Bump!

    Within your site you can turn any php page into a WordPress enabled page by adding

    require_once(‘./blog/wp-blog-header.php’);

    Once you’ve done that, you can reference posts, etc.. using WordPress tags just as if you were writing a template.

    Thread Starter arturocivit

    (@arturocivit)

    Hi mrmist, thanks for that, actually I already did that, but isn’t working, I’m not receiving a single bit of data, I tried with

    `<?php
    require_once(‘Blog/wp-blog-header.php’);
    ?>`

    and

    <?php
        require_once('./Blog/wp-blog-header.php');
        ?>

    it’s probably a path issue

    ./Blog/wp-blog-header.php

    would indicate the same folder as the file you are creating.

    try just

    /Blog/wp-blog-header.php

    and be sure that is at the top of your new file. Most sites are case-sensitive too, so be sure it’s Blog and not blog, or vice versus.

    Thread Starter arturocivit

    (@arturocivit)

    Hi myinstinctwaswrong, thanks a lot, yes, that might be one thing, the other question is, where can I take the tags in order to display at least the last 2 posts from the blog?

    Thanks a lot

    Arturo

    my client installed a version of WP

    Earn your money!!! Use the docs!!!!

    ./Blog/wp-blog-header.php

    would indicate the same folder as the file you are creating.

    try just

    /Blog/wp-blog-header.php

    I did provide a working sample piece of code based on the information I was given (IE wanting to load a wp header file from a subdirectory called Blog which is called from a file in the root). Of course /Blog would work in that scenerio too.

    Note, though, that neither would actually result in anything, you’d still actually have to call the relevant functions to get blog-like output. My line just includes the file.

    As whoami says, use the documentation to find out what to put to display various articles/links, or look at your existing WordPress templates for examples.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Question about PHP sites and WP’ is closed to new replies.