Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

This is most likely just a PHP problem, and it's probably a pretty simple answer, but I just can't seem to get my brain to function this morning. This is what I'm trying to do:

 $job_file = $cfs->get('job_file'); // job_file is a URL

 if ($job_file = NULL) {
     echo "NOT AVAILABLE";
 } else {
     echo '<a href="'. $job_file . '">' . get_the_title() . '</a>';
 }

It will display the URL of the current page instead of the $job_file variable. What am I missing?

share|improve this question
    
I am betting on @t-f's answer but on the off chance that that isn't it, what is $cfs and how is the data saved? –  s_ha_dum Sep 16 '13 at 15:34
    
t-f was correct. Pretty silly of me. –  joshmax Sep 16 '13 at 15:45
add comment

1 Answer

up vote 3 down vote accepted

Well, this is PHP...

if ($job_file == NULL) {
    ...

You might want to compare, and not set, right?

share|improve this answer
    
See, I knew it was something simple I was forgetting... Thanks. –  joshmax Sep 16 '13 at 15:45
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.