This code enables you to customize the default Genesis featured posts widget from your child themes folder and modify the code safely so its not lost when Genesis updates.
The reason i have written this tutorial is because of 2 forum questions i read recently, both of which are pretty much the same question:
I am looking to re-position post meta area before post title with image aligned left.
Code Installation – Beginners Guide
- Copy the PHP code from the view raw link in the Gist labelled genesis-post-widget.php and paste it into a new file named genesis-post-widget.php using a code editor like Notepad++.
- Upload the file to the root directory of your child themes folder.
- Copy the code from the Gist labelled functions.php and paste it at the end of your child themes functions.php file.
- You’ll then find a new widget named Genesis Custom Posts under Appearance > Widgets.
Note: You can change the classes in the code or use CSS from any StudioPress child theme for the Genesis Featured Posts widget and change the classes to match what you have in the code of the Genesis Custom Posts widget.
Debbie Hastings says
Hey Brad. I’d like to add some CSS around the month, day, year for this. Is there a way to do that? I’ve been able to do it for post meta on the blog pages, but can’t see to find where to do it for the featured post.
Brad Dalton says
Link to the featured posts widget on a live site please.
Thanks for the code — will come in very handy. Any quick suggestions where to hardcode (for simplicity over updating all of plugin) a line to exclude a category, i.e. basically want to show all post, excluding previously shown, but nothing from Category X.
Brad Dalton says
You can modify the code to exclude a category the same way you would exclude a category using WP_Query but the changes will be hard coded into your custom genesis featured posts widget.