I'm trying to insert a relative URL in the code below before "/images" in $thumb_directory and $orig_directory however I'm not sure how to do so within 'apostrophe's'. Also, this is a WordPress website, so if anyone knows how to call the function within '/images', like so: '/images' please let me know (I realize that what I just typed is incorrect syntax).
<?php
/* Configuration Start */
$thumb_directory = '/images';
$orig_directory = '/images';
$stage_width=600;
$stage_height=400;
/* Configuration end */
Assuming that the relative path is in the variable
$rel_path
, use double quotes:With double quotes variables (starting with
$
) are replaced by their value, but this doesn't happen with single quotes.Or use string concatenation:
EDIT
If your relative path comes from
bloginfo('template_directory')
, simply add the following line before using$rel_path
(so before the lines above):This sets the variable with the path you want. Ensure all these lines are within the PHP processing tags
<?php
and?>
, and don't forget the semicolon;
at the end of the assignment line ;-)