WordPress.org

Support

Support » How-To and Troubleshooting » write a php tag inside another php tag

write a php tag inside another php tag

  • Hi,
    How can I write this php tag :

    <?php echo get_option(‘myid’); ?>

    Instead cat id (20) in this php loop :

    <?php query_posts(‘cat=20&showposts=4’); ?>
    <?php while (have_posts()) : the_post(); ?>

Viewing 3 replies - 1 through 3 (of 3 total)
  • Michael

    @alchymyth

    Forum Moderator

    <?php query_posts('cat=' . get_option('myid') . '&posts_per_page=4'); ?>
    <?php while (have_posts()) : the_post(); ?>

    oh my friend ver very thank u ,

    and for use this :

    <?php
    If ( get_option('your_checkbox') == 'true' ){
    <div class="topic_container">
          <div class="topic_container_title">
          <div class="topic_container_icon"><img src="<?php bloginfo('template_directory') ?>/images/about-icon.png"></div>
          <h3>about</h3>
          </div>
          <div class="topic_container_content"> text </div>
          </div><!--topic_container-->
    
    } else {
    // something
    }
    ?>

    what can I do !?

    Michael

    @alchymyth

    Forum Moderator

    you will need to close the php tags before you use html, and vice-versa.

    please refer to a php tutorial – your question is not specific to WordPress

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘write a php tag inside another php tag’ is closed to new replies.
Skip to toolbar