This code creates a featured post widget which only displays your custom post types ( CPT’s ) featured image and title, content or excerpt in Genesis child themes like this example:
This solution enables web designers and theme Developers the option to create a custom widget for clients rather than use a 3rd party plugin.
Included is the CSS to display each featured CPT post entry inline as seen in the above screenshot.
Rather than display the title for each post, the widget also enables you to add a custom excerpt which you can display as the title instead of the default entry title as seen in the above screenshot.
If you click on the image, it links back to each single CPT post.
You can also change the widget to display any number of featured images inline and display them by using any of the WP_Query parameters.
Code & Simple Installation Instructions
To create the new widget, simply copy and paste each snippet as instructed.
After installing the above code, you can then go to Appearance > Widgets and drag your new custom widget into your After Header widget area and configure the widget settings.
Was This Tutorial Helpful?