Defining Constants correctly?

I asked this question elsewhere, and was told with the following code, that I was using my defines incorrectly? So nothing is getting returned currently –

I have tried setting constants in functions.php –

Read More
define( 'THEME_DIR', get_template_directory() . '/' );
define( 'THEME_URI', get_template_directory_uri() . '/' );

and then in my config file –

$sample_patterns_path = 'THEME_DIR' . '../sample/patterns/';
$sample_patterns_url = 'THEME_URI' . '../sample/patterns/';

Related posts

1 comment

  1. Use this code, without slashes:

    $sample_patterns_path = THEME_DIR . 'sample/patterns/';
    $sample_patterns_url = THEME_URI . 'sample/patterns/';
    

Comments are closed.