Looking for Hook re: customizing post content on homepage (Education)

Community Forums Forums Design Tips and Tricks Looking for Hook re: customizing post content on homepage (Education)

This topic is: resolved

This topic contains 7 replies, has 2 voices, and was last updated by  daveburris 1 year, 5 months ago.

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #12273

    daveburris
    Participant
    Post count: 5

    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.

    #12287

    David Decker
    Moderator
    Post count: 93

    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.


    #12316

    daveburris
    Participant
    Post count: 5

    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.

    #12320

    David Decker
    Moderator
    Post count: 93

    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.


    #12321

    daveburris
    Participant
    Post count: 5

    Great. If I could widgetize the content loop, that’d be great. Is there a simple hook or snippet for that?

    #12367

    David Decker
    Moderator
    Post count: 93

    Great!

    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 :)


    #12610

    daveburris
    Participant
    Post count: 5

    Thanks so much, David. That worked like a charm.

    #14984

    daveburris
    Participant
    Post count: 5

    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?

    Thanks.

Viewing 8 posts - 1 through 8 (of 8 total)

You must be logged in to reply to this topic.