• I’m dying to know the answer to this one, I spent an entire Friday night on it.

    I’m using WordPress 2.8.6, with Category Icons, Simple tags plugin.

    I need to display the following using the loop:

    A page, titled “Content List” that lists entire sites posts in one single page as:

    -Category icon for the post(I’m using category icons plugin, which plugs into the loop, that’s why I need to use the loop)
    -Post title for the post
    -Relevant posts tags with hyperlinks

    I created a simple page, created a template and applied the template to the page, yet nothing seems to display my posts under the page. I tried working with my ARCHIVES contents as well as my entire INDEX’s contents and somehow each time Content List page fails to show the entries. I worked with many LOOP examples yet they don’t seem to display anything when used under the template.

    <?php wp_get_archives(‘type=alpha’); ?> works but that doesn’t help me get the tags in there.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Don’t have Category Icons installed but this could work:

    <?php
        $args=array(
          'posts_per_page'=>-1,
          'caller_get_posts'=>1
        );
        $my_query = new WP_Query($args);
        if( $my_query->have_posts() ) {
          //this is necessary to show the tags (should not be necessary at 2.9)
          global $wp_query;
          $wp_query->in_the_loop = true;
    
          echo 'All Post Titles with their tags';
          while ($my_query->have_posts()) : $my_query->the_post();
            $values = get_post_custom_values('caticons_page');
            if (function_exists('get_cat_icon') && isset($values[0])) {
              get_cat_icon('link=false&class=myicons&cat='.$values[0]);
            } ?>
            <p><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></p>
           <?php
           the_tags('Tags: ', ', ', '<br />');
          endwhile;
        } //if ($my_query)
      wp_reset_query();  // Restore global post data stomped by the_post().
    ?>

    Hi,

    I think it should work if you replace MichaelH’s loop by this one :

    while ($my_query->have_posts()) : $my_query->the_post();
    	  	$the_icon = '';
            $values = get_post_custom_values('caticons_page');
            if (function_exists('get_cat_icon')) {
              $the_icon = get_cat_icon('link=false&class=myicon&echo=false');
            } ?>
            <p><?=$the_icon?><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></p>
           <?php
           the_tags('Tags: ', ', ', '<br />');
          endwhile;

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘List of post titles with their tags under a page’ is closed to new replies.