How can I put this php into this html? -
so have 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 put php code above '.$thisisworking.'
below. keep getting semi colon unexpected php errors when 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 tell me how can achieved?
echo em_events::output( array('format'=>
how wordpress plugin author, says templates modify wordpress plugin should coded. can please?
update: tried doesn't seem make difference:
function letsmakethiswork() { $latest_cpt = get_posts("post_type=event"); foreach ( $latest_cpt $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>
turn function?
function foo() { ... mangled code ... return $whatever_you_built; } $string = "foo bar " . foo() . " baz qux";
Comments
Post a Comment