So I have the following php:
$latest_cpt = get_posts("post_type=event&numberposts=1");
$theidone =$latest_cpt[0]->ID;
$this_post_id = $theidone; //get_the_ID();
$key_2_value = get_post_meta( $this_post_id, 'custom_select', true );
if( ! empty( $key_2_value )) {
$thisisworking = $key_2_value ;
;}
I need to put all the php code above where '.$thisisworking.' is below. I keep getting semi colon is unexpected php errors when I try.
div id="indent">
<span style="font-size:0.2em">
<h2><?php echo $EM_Category->output('#_CATEGORYNAME'); ?></h2>
</span>
<?php echo $EM_Category->output('#_CATEGORYNOTES'); ?></p>
<p> <?php //echo $EM_Category->output('#_CATEGORYALLEVENTS'); ?> </p>
<?php echo EM_Events::Output( array('format'=>
'
<li>
<br />
<span style="color: #ed834e; clear:both; display:block"> '.$thisisworking.'#_EVENTNAME </span>
</li>
<br />
<b>
<li>
Can someone tell me how this can be achieved?
echo EM_Events::Output( array('format'=> is how the wordpress plugin author, says templates to modify his wordpress plugin should be coded. Can anyone help please?
UPDATE: I tried this but it doesn't seem to make any difference:
function letsmakethiswork() {
$latest_cpt = get_posts("post_type=event");
foreach ( $latest_cpt as $cpt_post ) {
$theidone =$cpt_post->ID;
$this_post_id = $theidone; //get_the_ID();
$key_2_value = get_post_meta( $this_post_id, 'custom_select', true );
if( ! empty( $key_2_value )) {
$thisisworking = $key_2_value ;
}
return $key_2_value;
}
}
// END OF NEW CATEGORY SYSTEM
?>
<div id="indent">
<span style="font-size:0.2em">
<h2><?php echo $EM_Category->output('#_CATEGORYNAME'); ?></h2>
</span>
<?php echo $EM_Category->output('#_CATEGORYNOTES'); ?></p>
<p> <?php //echo $EM_Category->output('#_CATEGORYALLEVENTS'); ?> </p>
<?php echo EM_Events::Output( array('format'=>
'
<li>
<br />
<span style="color: #ed834e; clear:both; display:block"> '.letsmakethiswork().'#_EVENTNAME </span>
</li>
<br />
<b>
<li>
;}but then I don't do PHP