Recent Posts Widget for Custom Post Types

Community Forums Forums General Discussion Recent Posts Widget for Custom Post Types

This topic is: not resolved

Tagged: 

This topic contains 2 replies, has 2 voices, and was last updated by  tanzen 1 year, 1 month ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #68575

    tanzen
    Participant
    Post count: 6

    I need a widget that works exactly like the WordPress default ‘Recent Posts’ widget, but can display custom post types. I need it to display the posts in a list like the WordPress one does. I’ve tried others like Genesis Featured Posts Amplified but they don’t display the posts in the same way as the WordPress one. Any suggestions?

    #69403

    Sridhar Katakam
    Participant
    Post count: 1071

    1) Install and activate Bill Erickson’s Display Posts Shortcode plugin.

    2) Add this in child theme’s functions.php:

    add_filter('widget_text', 'do_shortcode');

    3) Add this in a text widget where you would like to display your CPT entries:

    [display-posts post_type="portfolio" posts_per_page="6"]

    change ‘portfolio’ in the above to the name of your CPT.

    Screenshot:

    screenshot


    #72770

    tanzen
    Participant
    Post count: 6

    Perfect thanks!

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.