Forums

[Plugin: EG-Series] Retrieving a post serie without shortcodes (2 posts)

  1. Jeremy Boggs
    Member
    Posted 2 years ago #

    Nice plugin! Is there a way to retrieve data about a post serie (name, posts in the serie) with PHP instead of the shortcodes? I'd like to use this on a static page template outside of the loop.

    http://wordpress.org/extend/plugins/eg-series/

  2. EmmanuelG
    Member
    Posted 2 years ago #

    Hi

    The plugin uses only "custom fields". So you can use the "post_meta" functions.

    Otherwise, if you want to get all series with their posts, you can request database with the following query:

    $meta_key= ... ;
    $orderby='menu_order';
    $order='ASC';
    $sql = 'SELECT DISTINCT ID, meta_value, post_title, post_date, post_status, menu_order FROM '.$wpdb->posts.' ,'.$wpdb->postmeta.' WHERE meta_key="'.$meta_key.'" AND ID=post_id ORDER BY meta_value ASC, '.$orderby.' '.$order;
    $results = $wpdb->get_results($sql);

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags