Skip to:
Content
Pages
Categories
Search
Top
Bottom

Custom page type with blog posts and activity on Customizr theme


  • lordmatt
    Participant

    @lordmatt

    What I am trying to do is add a custom page type to my customizr child theme. This page would act as the front page for the site. I want to replicate most of the features of the current front page but show the (public) activity stream in a central column and recent blog posts in a sidebar (rather than filling the page as at present). A bit more like Facebook etc..

    I’m getting my head around the complicated beast that is Customizr but I am clueless as to what I need to even start looking at to put the activity feed on the page as well.

    I’m feeling overwhelmed by something that I keep thinking should be relatively straight forward. I would welcome some guidance to ease me into this.

Viewing 15 replies - 1 through 15 (of 15 total)

  • Venutius
    Moderator

    @venutius

    Hi there,

    What I would do is set WP to use static front page and then add the features you want using a shortcode. for example for activity there is BP Activity Shortcode.


    lordmatt
    Participant

    @lordmatt

    That would certainly be easier.


    Venutius
    Moderator

    @venutius

    What I typically do is use a page builder to build the new front page, then insert widgets for all the features I want on that page.


    lordmatt
    Participant

    @lordmatt

    I’ve run into a bit of a roadblock doing it this way. Well, two actually.

    1. What is the shortcode for activity?

    2. How do I display the latest blog posts?

    I’m not super familiar with Nimblebuilder so I could be missing something. I am starting to think I’d like to work out how to do this natively with PHP.


    Venutius
    Moderator

    @venutius

    If you use a page editor you can use the activity widget that comes with BP, otherwise you can use the BP Activity Shortcode plugin. For Posts, I’m sure you can find a recent posts shortcode plugin in WP.org.


    lordmatt
    Participant

    @lordmatt

    I see. I’m not fond of adding too many plugins. I know this could be done as part of the child theme. That’s what I feel would be the best approach – that would keep extra plugins away from the multisite blog owners.

    The thing is, I’m having a heck of a time getting my head around the BuddyPress template stack. I have worked out I’ll need two loops – WP and BP but that’s about it.


    Venutius
    Moderator

    @venutius

    Then you’d need to overload your child-themes template file for the homepage, but getting the activity on there would need quite a bit of coding.

    BP was designed to be customised with plugins, it’s not unusual for a BP site to have several tens of plugins and maybe more.


    lordmatt
    Participant

    @lordmatt

    BP was designed to be customised with plugins, it’s not unusual for a BP site to have several tens of plugins and maybe more.

    Oh gosh. Sounds like a ton of work.


    Venutius
    Moderator

    @venutius

    If you were to go ahead with the idea of overloading the front page you’d need to use bp_has_activities() as part of the activity loop. You can check out how it’s used by looking at plugins/buddypress/bp-templates/bp-legacy/buddypress/activity/activity-loop.php


    Venutius
    Moderator

    @venutius

    Loading plugins is a lot less work that writing the code from scratch


    lordmatt
    Participant

    @lordmatt

    Loading plugins is a lot less work that writing the code from scratch

    This is true. I’ve worked as PHP developer before and I quite enjoy the coding part of things so that’s not the biggest worry for me.

    I’ll take a look at that loop. That should tell me most of what I need to know.


    Venutius
    Moderator

    @venutius

    Ah sorry was assuming too much. In that case take a look at the BP Nouveau equivalent of that page in bp-templates/bp-nouveau/buddypress/activities/activity-loop.php. In nouveau the activity is generated mainly by js, you just have to recreate the right class and id structure in the page and nouveau will automatically implant the activity, no need for the loop. But this only works for the default activity settings, if you want to filter them I’m not certain how to go about doing that.

    Legacy represents that old way, with page loads and a php loop. Nouveau is highly js with js fetching the content without page loads.


    lordmatt
    Participant

    @lordmatt

    I’m guessing I could just include ./wp-content/plugins/buddypress/bp-templates/bp-nouveau/buddypress/activity/activity-loop.php?


    Venutius
    Moderator

    @venutius

    If I remember correctly last time I did it I had to convince js that it was in a bp page, so I hade to recreate all or most of the bp div structure, then nouveau recognised it and inserted the activity


    lordmatt
    Participant

    @lordmatt

    Bingo – sounds good!

    I was toying around with this and getting nowhere:

    if ( !function_exists( 'bp_core_load_template' ) ) { 
        require_once '/bp-core/bp-core-catchuri.php'; 
    }  
    $templates = array('bp_core_template_plugin', 'buddypress/activity/activity-loop'); 
    $result = bp_core_load_template($templates); 
Viewing 15 replies - 1 through 15 (of 15 total)
  • You must be logged in to reply to this topic.
Skip to toolbar