WordPress.org

Ready to get started?Download WordPress

Forums

[P2 TIP 001] add auto todo items (1 post)

  1. cogmios
    Member
    Posted 5 years ago #

    here is a tip for the P2 theme: auto add a list of todo items when the tag is "todo" (the inline tag thing plugin is then also handy):

    <h2>Todo</h2>
    <ol>
    <?php
    $args=array(
        'tag__in' => array(5),
    	'showposts' => 50
    );
    $my_query = new WP_Query($args);
    if( $my_query->have_posts() ) {
        while ($my_query->have_posts()) : $my_query->the_post(); ?>
          <li><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></li>
          <?php
        endwhile;
    } else {
    	echo "no todo";
    }
    ?>
    </ol>

Topic Closed

This topic has been closed to new replies.

About this Topic

  • RSS feed for this topic
  • Started 5 years ago by cogmios
  • This topic is not a support question
  • WordPress version: 2.8

Tags