govfresh / govpress

The WordPress theme for government
https://wordpress.org/themes/govpress/
GNU General Public License v2.0
135 stars 51 forks source link

Homepage widgets #27

Closed lukefretwell closed 10 years ago

lukefretwell commented 10 years ago

Add widget section for homepage main content area.

See http://wp.govfresh.com as point of reference.

The way I initially set it up was as a page template (page-home.php) with the following elements:

devinsays commented 10 years ago

I added a home page template and updated the theme so that the home page hero and icon menu show based on the is_page_template('templates/home-page.php') conditional.

I also pulled the home page hero and icon menu code out of header.php (to make it more readable) and included it in a template partial (above-home-page.php). This potentially makes it more extendable and reusable.

I've been reluctant to implement this template fully because it is very proscriptive. I could see use cases where:

I often get support requests for changing small items like this in themes I've made. On the other hand, being proscriptive makes for a quicker set up and a lot let options overhead. Difficult balance.

Let me think through this a bit more. I am considering a shortcode or meta fields to manage the number of items displayed and order.

Feedback or further thoughts welcome.

lukefretwell commented 10 years ago

Agree on comments. Perhaps being able to make it widgetable below the icons in the main area would suffice?

devinsays commented 10 years ago

This was updated as part of this commit: https://github.com/govfresh/govpress/commit/acf85849172acd5c84b09ad9c4befc564f6b9758