• Resolved r91andersson

    (@r91andersson)


    Hi!

    Would it be possible to setup the list programmatically and include the posts by their IDs?

    Let say I have posts with the ID 201,212,219, and I only want to show these.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Content Views

    (@pt-guy)

    Hello,
    You can insert these post IDs to the Filter Settings > Include Only field.

    Thread Starter r91andersson

    (@r91andersson)

    Yes I know that, but I want to automate this, so that once a post have been created by the system automatically, the list should update accordingly so that the post ID gets included. So I would need to update the “Include Only” field programmatically by code rather than by doing it manual by hand.

    Thanks in advance!

    // Robin

    Plugin Author Content Views

    (@pt-guy)

    Dear Mr Robin,
    Thank you for your information.

    Inserting dynamic post IDs is available in Content Views Pro.
    Here is detail document http://docs.contentviewspro.com/reuse-a-view/
    The post_id parameter will work for your need.

    For example, you got list of post IDs in a variable. You can use this code:

    
    $post_ids = implode( ',', $post_ids );
    echo do_shortcode( "[pt_view id=VIEW_ID post_id='$post_ids']" );
    

    Best regards,

    Thread Starter r91andersson

    (@r91andersson)

    Thanks!

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Progammatically setup and display posts by its ID’ is closed to new replies.