• Hi, thanks for supporting us and keep wordpress live and payfree!

    I want to locate my blog folder through php code.

    the folder structure of web server is the following:

    /
    /httpdocs/
    /httpdocs/blog/
    /subdomains/
    /subdomains/httpdocs/

    I am at this point inside subdomain/httpdocs folder and i want to go back to httpdocs/blog folder

    When i was at the same folder or domain I used this code:

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

    But now that i changed domain, I have proble to connect to my blog folder.

    Any help would be appreciated.

    Thanks.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Moderator James Huff

    (@macmanx)

    Volunteer Moderator

    Thread Starter gpolit

    (@gpolit)

    Dear james, my question was the following.

    I have a blog in a subdomain p.e. blog.url.gr

    I want to embed an article from this subdomain blog, to a page in main domain website in root address

    p.e. http://www.url.gr/article.php

    I know how to do this if blog and website page is in the same domain

    here is the code

    <?php
    require('./blog/wp-blog-header.php');
    $wp->init();
    $wp->parse_request();
    $wp->query_posts();
    $wp->register_globals();
    ?>
    
                                <?php
     							$lastposts = get_posts('numberposts=4');
     							foreach($lastposts as $post) :
       							setup_postdata($post);
     							?>
                                <li><a rel="nofollow" href="#"><?php the_title(); ?></a></li>
       <?php endforeach; ?>

    I don’t know how to make this link if they are in separate domain, in our case subdomain.

    Thanks.

    Any help would be appreciated

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Relocate blog folder’ is closed to new replies.