• Resolved katemgilbert

    (@katemgilbert)


    I want to build a table that shows data from a query posts loop. The first col. would show the title with link, 2nd col. author, 3rd col. excerpt, etc.

    I think this can be done with the PHP in tables extension, which is safe to use on our site. But I’m at a loss as to how to code the individual table cells to produce what I’m going for.

    Is there any documentation available or code examples related to a table of queried post data?

    https://www.ads-software.com/plugins/tablepress/

Viewing 1 replies (of 1 total)
  • Plugin Author TobiasBg

    (@tobiasbg)

    Hi,

    thanks for your post, and sorry for the trouble.

    I would actually not recommend TablePress for this. TablePress is much better in displaying static data, and not dynamic data like this.
    Instead, you should simply create a new page template in your theme where you run that query for the posts (with get_posts() or query_posts() or WP_Query() and related). Then, you would simply use the available Template Tags and use those within the relevant HTML tags for a table. Thus, this is a little bit like writing a theme, except that you are placing everything in HTML tags for tables instead of <div>s which most themes use.

    If you then want to make those tables searchable, sortable, etc. you can easily add the DataTables JS library manually, afterwards.

    Regards,
    Tobias

Viewing 1 replies (of 1 total)
  • The topic ‘Query posts and display data in table?’ is closed to new replies.