• Resolved avay

    (@avay)


    I have made a file in “/wp-content/themes/mytheme/inc/slider.php
    Now I want to include the file in index.php. I tried with include_once
    include_once get_template_directory_uri()."inc/slider.php";
    but I get following error :

    Warning: include_once(): https:// wrapper is disabled in the server configuration by allow_url_include=0

    Can you please tell the best way to include a file placed inside a theme?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Try this:

    include_once WP_CONTENT_DIR . '/themes/mytheme/inc/slider.php';

    Thread Starter avay

    (@avay)

    Thank you Josh for the suggestion. I tried following your hint

    include_once WP_CONTENT_DIR.”/themes/dfm/inc/slider.php”;

    but I couldn’t get the result, slider could not be seen.

    Thread Starter avay

    (@avay)

    I used

    include_once TEMPLATEPATH.”/inc/slider.php”;

    it worked..

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Include File’ is closed to new replies.