January 16, 2013 at 8:24 am #12273
I'm looking for a hook to customize the home page in the Education Theme so that I can bring in a page in that spot instead of blog posts. I might be able to wing it, but I imagine this has popped up before. In the old Education Child Theme, the section was widgetized, but it doesn't appear to be so in the new, responsive version. Any help would be appreciated. Thanks.January 16, 2013 at 9:01 am #12287
In Education 2.0 you have widgetized areas before the actual content, so in the upper part of the home page.
The blog posts below are from the "real" home page. To make use of a regular page here just setup a new page, after that go to your WordPress settings under "Settings > Reading" and setup your static home page. This should really do it if I understand you correctly.
January 16, 2013 at 10:06 am #12316
Thanks for that. My understanding is that doing what you recommend will replace the entire home page. What I'd like to do is keep the homepage slider & homepage widgets and instead get a hook that pulls a designated page into just the content area. If you know of a hook that will accomplish that, I'd appreciate it. Thanks again for your help.January 16, 2013 at 10:20 am #12320
Ok, thanks for your feedback, I now understand what's going on 🙂
The "issue" is that WordPress differentiates between the state "is_home()" (served via a file home.php) and "is_font_page()" when setting a regular page as the home page.
I see two alternatives to get what you want:
Using the packaged "home.php" and make it's regular content (in that case the "loop") widgetized so you could place in anything you want.
Or you could re-add the stuff for the top area from the home.php to your functions.php and make a conditional statement to only do that for a page ID --- just for that page ID that you before set up as static homepage.
Both should keep the "header / top" stuff intact.
Personally I would go the "widget" way. But it's up to you. I could help with the code snippets if you want.
January 16, 2013 at 10:23 am #12321
Great. If I could widgetize the content loop, that'd be great. Is there a simple hook or snippet for that?January 16, 2013 at 1:05 pm #12367
Please make a backup of your functions.php and home.php first! (Always better to have 🙂
Then add these pieces of code to the files:
The first part goes into the home.php file, at the bottom but BEFORE the closing "genesis();".
The second part goes into the functions.php, also best at the bottom.
For both, don't copy the beginning "< ?php" lines!!
What it does: it first registers a new widget area in your functions.php, then in your home.php it removes the content loop, replaces with widget stuff, but only if the area has active widgets.
I hope this helps. It could be that you have to make a few CSS minor fixes but just try if it works for you.
January 17, 2013 at 7:51 am #12610
Thanks so much, David. That worked like a charm.January 26, 2013 at 7:20 am #14984
David -- I've been using the #content to customize the CSS for that widget, but I'd like the widget to take on different properties than the rest of the content. Is there a different ID I should use that would customize just that homepage widget?
You must be logged in to reply to this topic.