• Hi,

    Trying to combine a couple snippets of code and it breaks the page – see below. How can I make that work?

    I’m pathetic with PHP so any help would be appreciated.

    Thanks!

    <?php if ( is_user_logged_in() ) { //This Breaks the page <?php $teaser = get_post_meta($post->ID, 'teaser-video', true); if ($teaser) {?>
        Teaser Logged In
        <?php } else { ?>
        No Teaser Logged In
        <?php } ?>
    
        } else {
    
        echo 'Not Logged In';
    
        };
    
        ?>

Viewing 1 replies (of 1 total)
  • <?php if ( is_user_logged_in() ) { //This Breaks the page <?php
    You are “going into php mode” again when you are already in php mode. Remove the second <?php

    Likewise <?php } ?> } else {
    is a problem as you get out of php with the ?> and then follow with the } else { php construct.

    It takes some getting used to, but all the php info one would ever need is here: http://ca.php.net/manual/en/index.php

Viewing 1 replies (of 1 total)

The topic ‘PHP Help please!’ is closed to new replies.