Support » Plugin: Add Posts to Pages » Does not work with Custom Post Types?

Viewing 1 replies (of 1 total)
  • It works with custom posts! U have to edit add-posts-to-pages->index.php

    function add_posts_func( $atts ) {

    //extracting input parameters (attributes of shortcode)
    extract( shortcode_atts( array(
    ‘show’ => -1,
    ‘category’ => ”,
    ‘post_type’ => ”,
    ‘tag’ => ”,
    ‘full’ => false,
    ‘h’ => ‘2’,
    ‘img’ => false,
    ‘size’ => 64,
    ‘readmore’ => false
    ), $atts ) );

    and

    //querying posts on input filter parameters
    $posts = get_posts(‘category_name=’.$category.’&posts_per_page=’.$show.’&post_type=’.$post_type.’&tag=’.$tag);
    wp_reset_postdata();

    shortcode = [add_posts category=CAT post_type=TYPE full=false img=true size=150]

Viewing 1 replies (of 1 total)
  • The topic ‘Does not work with Custom Post Types?’ is closed to new replies.