• I’m not sure how to echo a theme option in this code.

    <?php if (!is_page('72')) {
    echo "<div class=\"feat_top\"></div>
    <ul class=\"feat\">
    <div class=\"feat_inner\">
    <h4 class=\"largetext\">Title</h4>
    <?php echo get_option('sidetext'); ?> //this one
    
    </div>
    
    <div class=\"feat_bottom\"></div>";
    } ?>

    the “sidetext” option echoes blank. Is there a way to make it work?

Viewing 4 replies - 1 through 4 (of 4 total)
  • You can’t nest like that, one or the other, HTML or PHP, but you can switch between the two..

    See if this helps… ??

    <?php if (!is_page('72')) : ?>
    <div class="feat_top"></div>
    <ul class="feat">
    <div class="feat_inner">
    <h4 class="largetext">Title</h4>
    <?php echo get_option('sidetext');  // comments like this go inside the PHP area ?>
    <!-- comments in HTML areas look like this -->
    </div>
    <div class="feat_bottom"></div>
    <?php endif; ?>

    Thread Starter nemci7v

    (@nemci7v)

    ooh cool! thanks ??

    So I guess the : in

    <?php if (!is_page('72')) : ?>

    connects the php condition with the code below?

    It’s just a different way of wrapping conditional statements.. ??

    if( something ) {
    
    // something
    
    }

    is the same as..

    if( something ) :
    
    // something
    
    endif;

    Thread Starter nemci7v

    (@nemci7v)

    oooh I see! Thanks for helping ??

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘php tags within php tags’ is closed to new replies.