Support » Fixing WordPress » How To Create Dynamic Table Listing Posts and Using Custom Fields???

  • Resolved raynerlim36



    I’m sorry that the title may be a little misleading, but I tried to keep it “brief and descriptive”.
    Also, I don’t mean to be rude here but I am in a big hurry so I am hoping people will respond fast.

    Okay, I’ll be straight to the point now:

    I need to have a table with the headers “Title”, “Author”, “Class”, “Year”. I want the table to add a row for every post from a certain category, with the title of the post in the “Title” field, and the “Author”, “Class” and “Year” fields being populated with information from that post’s custom fields/metadata.

    Secondarily and not so importantly, I need the table to have alternate row colours and must be sortable.

    Maybe you could recommend me a suitable plugin (I haven’t found any to be suitable) or give me the code and instructions. Please, no telling me to write code myself as I can’t!

    Thanks a lot for any help you are going to give me!


Viewing 7 replies - 1 through 7 (of 7 total)
  • Sorry MichaelH, but how do I make use of the plug-in to generate a table? Sorry but I really need tutorials to teach me how to do it as I’m not a coder.

    What I need is like WP-Table Reloaded but is dynamically loaded and not a static table. I guess it may be hard, that’s why I’m asking for help here. Thanks.

    Since you didn’t want to do any coding, I linked to some plugins that will display posts without having to code templates.

    You may consider revising your requirements.

    Thank you for your help, MichaelH.

    I’m sorry but I really need the dynamic table.
    Maybe I can cut down my requirements a bit, so is there a plug-in that can list posts from a certain category in a tabular format (does not need to be from; I don’t know how to search for it)?
    I just need some sample code (if that is possible) as to how to add a row for every post with “Title” for the table header, then maybe I can slowly build up from that foundation? Just really, really need a table that displays pots, no matter how simple it is.

    Also on a side note, I’m actually using BuddyPress and a Buddypress theme, so should I post here or in the BuddyPress forums?


    Display 5 posts with two custom fields called “class” and “year” in a table.

      'post_type' => 'post',
      'post_status' => 'publish',
      'posts_per_page' => 5,
      'caller_get_posts'=> 1
    $my_query = null;
    $my_query = new WP_Query($args);
    if( $my_query->have_posts() ) {  ?>
     	<TABLE border="1" summary="This is a table with no class">
      <CAPTION><EM>A table with no class </EM></CAPTION>
      while ($my_query->have_posts()) : $my_query->the_post();
        $class = get_post_meta($post->ID, 'class', true);
        $year = get_post_meta($post->ID, 'year', true); ?>
        <tr><th><?php the_title(); ?><td><?php the_author(); ?><td><?php echo $class; ?><td><?php echo $year; ?>
      <?php endwhile; ?>
    <?php }

    Stepping Into Template Tags
    Stepping Into Templates
    Template Hierarchy

    Thanks very much! Worked like a charm.
    Changed topic status to resolved.

    I’ll mark as resolved but you can do that over there —>

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘How To Create Dynamic Table Listing Posts and Using Custom Fields???’ is closed to new replies.