How to make a conditional statement within $output in shortcodes.php?

If I understand you right you just want to use a ‘?’ type of if statement:

$output="<div class="w-blog-entry" style="padding:0;">
                            <div class="w-blog-entry-h">
                            <div class="l-subsection color_dark" style="background-image: url(".$the_thumbnail.'); background-position: center center; padding-top:0; padding-bottom:0; background-attachment: inherit;">
                            <div class="l-subsection-h">
                                <div class="l-subsection-hh g-html i-cf" style="font-family:Century Gothic; text-shadow: 0px 2px 2px rgba(0, 0, 0, 0.3);">
                                    <a class="w-blog-entry-link" href="'.get_permalink(get_the_ID()).'"><h2 class="w-blog-entry-title" style="line-height:1em; margin-left:0; padding-left:4px; font-size:20px;"><span class="w-blog-entry-title-h" style="color:#fff;">'.get_post_meta( get_the_ID(), 'destination', true ).'<br><span style="font-size:0.6em; color:#f2f2f2;">'.get_post_meta( get_the_ID(), 'depart', true ).' <span style="text-transform: lowercase; font-size:0.8em;">to</span> '.get_post_meta( get_the_ID(), 'return', true ).'</span></span></h2></a>
                                    <p style="line-height:1.2em; padding-left:4px; font-size:0.9em;">'.get_post_meta( get_the_ID(), 'projectdesc', true ).'</p>';
$output .= get_post_meta( get_the_ID(), 'campus', true ) ? '<p>True so do this paragraph</p>' : '<p>false, so do this instead</p>';
$output.='                                    </div>
                            </div>
                        </div>

                        </div>';

A standard if else would have worked OK too so I’m not sure where the confusion was.

Another way is to use a php output buffer which would work like this:

ob_start();
?>
<div class="w-blog-entry" style="padding:0;"> etc etc
<?php if(get_post_meta( get_the_ID(), 'campus', true )) {?>
<p>True paragraph</p>
<?php }else{ ?>
<p>false paragraph</p>
<?php } ?>

And then when you’ve finished with all your output you put it in your $output variable like this:

$output = ob_get_clean();

When you start an output buffer it basically means that any HTML you put outside of the PHP tags goes into the buffer rather than being output to the browser. I prefer this sometimes when there’s a lot of different conditions and logic in the output.

ob_start, ob_get_clean