WordPress.org

Ready to get started?Download WordPress

Forums

write a php tag inside another php tag (4 posts)

  1. Jhihaat
    Member
    Posted 9 months ago #

    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(); ?>

  2. alchymyth
    The Sweeper & Moderator
    Posted 9 months ago #

    <?php query_posts('cat=' . get_option('myid') . '&posts_per_page=4'); ?>
    <?php while (have_posts()) : the_post(); ?>
  3. Jhihaat
    Member
    Posted 9 months ago #

    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 !?

  4. alchymyth
    The Sweeper & Moderator
    Posted 9 months ago #

    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

Reply

You must log in to post.

About this Topic

Tags