I've used this if/else code with More Fields plugin before within template files before with success, but am having problems with using in functions.php file in Thematic child theme.
Would someone mind staring at this code with me for a moment and tell me where the problem is?
It might be just some php syntax problem I'm unaware of (as opposed to More Fields oriented).
___________
Here's an example that looks for data in the author-website field and, if available, wraps that data in an anchor tag with the author-name data as the link text. Otherwise, it just displays the author-name data:
<?php $author-website = get_post_meta($post->ID, 'author-website', true);
if ($author-website) {
print '<a href="http://';
echo get_post_meta(get_the_ID(), 'author-website', true);
print '" title="View author’s website">';
echo get_post_meta(get_the_ID(), 'author-name', true);
print '</a>';
} else {
echo get_post_meta(get_the_ID(), 'author-name', true);
} ?>
Problem is, I get a syntax error about an unexpected "=" in the first line.
If I put in double equals "==" in the first line like so:
<?php $author-website == get_post_meta($post->ID, 'author-website', true);
...the page shows but ignores the first "if" section and only shows the "else" part which is just the author's name with no link even when there IS website data.
____________
Any ideas on what about using the above code in a child theme functions.php file would cause this...?