1. Knowledge Base
  2. Posts Table Pro
  3. Developer documentation

Template functions

ptp_get_posts_table

This function can be used in your theme or plugin to retrieve a posts table, passing a list of arguments as an array.

Arguments

array $args – The list of arguments to create the posts table. The array keys supplied should match the shortcode option names. List-based arguments (such as the columns option) can be passed as a comma-separated string or an array.

Return

string – The complete HTML for the posts table.

Example
$args = array( 
  'columns' => 'title,author,date,tags',
  'filters' => true,
  'category' => 'featured'
);
$table = ptp_get_posts_table( $args );

ptp_the_posts_table

Similar to the above function, but will print (i.e. echo) the table output, rather than return it.

Example
echo '<h2>Featured posts</h2>';
ptp_the_posts_table( array( 'category' => 'featured' ) );
Arguments

array $args – The list of arguments to create the posts table. The array keys supplied should match the shortcode option names. List-based options (such as the columns option) can be passed as a comma-separated string or an array.

Still need help?

If searching the knowledge base hasn't answered your question, please contact support.

Related Articles