I am trying to display the answer to a custom question using EE_ANSWER shortcode but I am struggling with a problem that I can’t figure out.
If i use this code defining the attendee id, it works fine.
$attid = ‘[att_id]’;
$custom_question_1 = do_shortcode(‘[EE_ANSWER q=”11″ a=”25″]’);
echo $custom_question_1;
But then if I try to use this code it returns this : “]
$attid = ‘[att_id]’;
$custom_question_1 = do_shortcode(‘[EE_ANSWER q=”11″ a=”‘.$attid.'”]’);
echo $custom_question_1;
I have tried many different combinations. They either not work or return the same.
It’s kind of hard to tell from the code you posted, but it may be the mixed single and double quotes. Can you post the code, in the content of the files you’re working on in a pastebin and link to it from here so we can get a clear look?
I copied the line of code form attendee_list.php (line 87) and I am using it in badge-sm.php. I am not sure of what you are asking but here is the complete code, hope this works:
<pre class=”brush: php; gutter: true; first-line: 1; highlight: []; html-script: false”><?php
global $org_options;
//Build the path to the css files
if (file_exists(EVENT_ESPRESSO_UPLOAD_DIR . "tickets/templates/css/base.css")) {
$base_dir = EVENT_ESPRESSO_UPLOAD_URL . 'tickets/templates/css/';//If the template files have been moved to the uploads folder
} else {
$base_dir = ESPRESSO_TICKETING_FULL_URL.'templates/css/';//Default location
}
//Output the $data (array) variable that contains the attendee information and ticket settings
//echo "".print_r($data,true)."";
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title><?php echo stripslashes_deep($org_options['organization']) ?> <?php _e('Ticket for', 'event_espresso'); ?> <?php echo stripslashes_deep($data->attendee->fname . ' ' .$data->attendee->lname) ?> | <?php echo $data->attendee->registration_id ?></title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<!– Base Stylesheet do not change or remove –>
<link rel="stylesheet" type="text/css" href="<?php echo $base_dir; ?>base.css" media="screen" />
Sorry I see my comment makes no sense now that I posted it but I can’t find any way to edit or remove. Here is a link to the code: http://pastebin.com/QzH3qeQ1
The support post ‘EE_ANWSER shortcode problem’ is closed to new replies.
Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.
Support forum for Event Espresso 3 and Event Espresso 4.