You’ve practically written it already. I use a global variable that I’ve set elsewhere..
<?php
if (isset($GLOBALS[‘dm_forced_title’])) {echo ‘<title>’.$GLOBALS[‘dm_forced_title’].'</title>’;}
else {
echo ‘<title>’;
echo ‘Some Other Title’;
echo ‘</title>’;
}
?>
Thanks for that mrmist.
Is there a way for me to just check whether my custom field is empty or not? I would like to use it outside the Loop if possible.
been looking for similar solution.
figured it out with the code in this comment.
so, if you want to check if c2c custom field has any content and echo something based on that this code works for me:
<?php
$VARIABLE_ID=c2c_get_custom('CUSTOM_FIELD_NAME');
if (!empty($VARIABLE_ID)) { echo " BLAHBLAHBLAH "; }
?>
in your code replace:
VARIABLE_ID
with something descriptive (var, var1, var2 etc.)
CUSTOM_FIELD_NAME
with the c2c field name you are checking
BLAHBLAHBLAH
with your content
if(!empty(...))
means “if the field is NOT empty”
i’m no PHP guru, all credit to the google for finding that 2005 comment from Nathaniel.
good luck.
rak.