• Resolved pooryamd

    (@pooryamd)


    Hi,
    I just enabled a network for my site and main site and sub-domains work prfectly. But I have some problems with including WP theme in my own pages (PHP pages) specially when my page is not under a wordpress sub domain and sub folder.

    In detail:
    I have a (network) WP site like example.com (public_html folder)
    And a subdomain in my network: sub1.example.com (public_html folder)
    And a non WP sub-domain: sub2.example.com (another folder)

    In PHP pages on my sub2 (non WP) I want to use wp theme (like I did before enabling network).

    The problem is:
    My sub2 sub-domain redirects to my main site.

    I use this code to use wordpress (header and footer):

    // Include WordPress
    define('WP_USE_THEMES', true);
    require('../public_html/wp-load.php');
    get_header();
    ... ... ...
    get_footer();

Viewing 1 replies (of 1 total)
  • Thread Starter pooryamd

    (@pooryamd)

    I found the way!

    1- temporarily, changed my sub2 root folder to wp folder (public_html)
    2- in my network admin, added a subdomain same as sub2 to my network
    3- changed lanuage, theme setting and header as needed and removed menu items (to hide menu!)
    4- changed my sub2 root folder back to its folder
    5- copied required and missing js, images and styles (inspected in chrome) to the same folder as called in my sub2 urls.

    bang!
    Wordpress theme loaded!
    No page breaks!

Viewing 1 replies (of 1 total)
  • The topic ‘Use WP theme in own (non WP) pages’ is closed to new replies.