Viewing 1 replies (of 1 total)
  • #2 is almost correct… you can not include a file from an URL.
    An URL is a website address for visitors. PHP will want an absolute location from within the hard drive. For myself this location is /var/www/html/. So for your file it would be /var/www/html/cms/wp-content/themes/fishy-11/sidebar80.php

    As far as the syntax of your address goes.. If you have a variable, then it should not be in quotes. Variables have a dollar sign in front of them by the way. Content on the other hand, which variables can replace, need single or double quotes around them. There is also defined constants, which will you see as upper case (TEMPLATEPATH), which are also variables, but without the dollar sign.

    Example, all of which are correct:

    <?php
    $theme = "/var/www/html/cms/wp-content/themes/fishy-11/";
    include($theme . '/sidebar80.php');
    
    include("/var/www/html/cms/wp-content/themes/fishy-11/" . "sidebar80.php");
    
    include("/var/www/html/cms/wp-content/themes/fishy-11/sidebar80.php");
    ?>

    Instead of using /var/ww/html/, you can use ABSPATH, but you have use it like $theme.

Viewing 1 replies (of 1 total)
  • The topic ‘Filepaths Advice on syntax please’ is closed to new replies.