WordPress.org

Forums

[resolved] How to show posts in a table on a new page from a single category? (9 posts)

  1. hasanmahmud
    Member
    Posted 2 years ago #

    I run an education information site. It publishes results and seat plans of different exams. I want to show all posts related to results in a new page and the posts will be arranged in a table.

    This table will be a simple on having 3 columns containing Post title, post date and link to full post.

    How can I manage to do that?

    Thanks in advance.

  2. Andrew
    Nuh uh moderator
    Posted 2 years ago #

    At the moment, do you have the information on the page but not the 3-columned format you want?

  3. hasanmahmud
    Member
    Posted 2 years ago #

    I have the information in full posts. but as i post other topics , this results are intermingled with other posts. Though when I visit category archives it shows the posts. But i want to show them in a table on new page.

    Suppose I want to show latest 10 posts from result category in the new page.

    I can make new page template. also can implement code to show posts as ordered list. but i want tables in lieu of lists merely.

  4. hasanmahmud
    Member
    Posted 2 years ago #

    I want to do something like this page on my site. This table is updated manually without any query. it is impossible to maintain this table regularly.

  5. alchymyth
    Forum Moderator
    Posted 2 years ago #

    general structure for posts in a table:

    <?php if( have_posts() ) : ?>
    <table>
    <tr>
    <td>TITLE</td>
    <td>TIME</td>
    <td>LINK</td>
    </tr>
    <?php while( have_posts() ) : the_post(); ?>
    <tr>
    <td><?php the_title(); ?></td>
    <td><?php the_time(); ?></td>
    <td><a href="<?php the_permalink(); ?>">LINK</a></td>
    </tr>
    <?php endwhile; ?>
    </table>
    <?php endif; ?>
  6. hasanmahmud
    Member
    Posted 2 years ago #

    Thanks Mr. alchymyth, but it shows the title of new page. I want to show the posts from the category. and the posts should be arranged in a table.

  7. alchymyth
    Forum Moderator
    Posted 2 years ago #

    you said earlier:

    I can make new page template. also can implement code to show posts as ordered list.

    you still need to do this - my code does not contain the part of getting the posts, but is only a suggestion to ouptput a loop into a table.

    can make new page template. also can implement code to show posts as ordered list.

    once you have done this, possibly paste the full code into a pastebin and post the link to it here - http://codex.wordpress.org/Forum_Welcome#Posting_Code - so somebody can help to adapt it to show in a table.

  8. hasanmahmud
    Member
    Posted 2 years ago #

    Oh, yea. Thanks. I have forgotten to make the query.

  9. hasanmahmud
    Member
    Posted 2 years ago #

    I make the page template and the template code is available here. Creation of any page with this page template will show posts from a specific category in that page.

Topic Closed

This topic has been closed to new replies.

About this Topic