This code enables you to display both standard posts and any custom posts types in the same widget area. The code generates another featured posts widget on the widgets admin page so you can use both if needed.
And here’s an example in a widget area on the front end showing 2 entries.
Tested using the Genesis Portfolio Pro plugin to register the portfolio CPT and code to register a custom post type.
Simply upload the folder named widgets to your child theme folder and add the following PHP code to the end of your child themes functions file.
Tutorial written based on this question from 2 members of the Genesis community:
I’m looking for recommendations on a genesis featured page/post widget. I’ve been using genesis sandbox from Travis Smith but it hasn’t been updated in a while. Main requirements: custom post types, mixing post and page in single widget, conform to genesis theme styling. What do you use and like? Brad Dalton can you give any more info on this? Any samples or tutorials to define possibilities? Can you then use it for both normal and CPT within the same site?
Here’s the widgets folder for logged in members
Leave a Reply
You must be logged in to post a comment.