Community Forums › Forums › Archived Forums › Design Tips and Tricks › Looking for Hook re: customizing post content on homepage (Education)
Tagged: education 2.0, home page
- This topic has 7 replies, 2 voices, and was last updated 10 years, 8 months ago by
daveburris.
-
AuthorPosts
-
January 16, 2013 at 8:24 am #12273
daveburris
MemberI'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 #12287David Decker
MemberIn 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 #12316daveburris
MemberThanks 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 #12320David Decker
MemberOk, 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 #12321daveburris
MemberGreat. 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 #12367David Decker
MemberGreat!
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.
-Dave ๐
January 17, 2013 at 7:51 am #12610daveburris
MemberThanks so much, David. That worked like a charm.
January 26, 2013 at 7:20 am #14984daveburris
MemberDavid -- 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?
Thanks.
-
AuthorPosts
- The forum ‘Design Tips and Tricks’ is closed to new topics and replies.