Skip to:
Content
Pages
Categories
Search
Top
Bottom

Activity Stream Homepage Compatibility Issues

  • @bazaarocommunity

    Participant

    I have several custom post types on my website that are not working correctly with a category search filter (http://docs.designsandcode.com/search-filter/) and BuddyPress. For example, I have applied the following code to one of my pages:

    <?php echo do_shortcode(‘[searchandfilter fields=”encyclopedia-category,post_date” types=”select,daterange” hierarchical=1 hide_empty=1 submit_label=”Filter”]’); ?>

    This is intended to filter “Encyclopedia” post types by category (http://dennishoppe.de/en/wordpress-plugins/encyclopedia). The filter works perfectly on my category and single page, but fails on the archive page.

    The issue is somehow connected to BuddyPress because when I set the BuddyPress Activity Stream page as my homepage, the filter stops working and redirects me to my home page and displays something similar to the following in the URL rather than displaying the category page as appropriate:

    https://sandbox.stratics.com/?encyclopedia-category=slug

    However, when I use any other static page as the homepage (such as a standard homepage instead of the Activity Stream), the filter starts working again. I suspect this has something to do with the way the search filter uses permalinks and the way BuddyPress treats permalinks when it is used as a homepage, but I am at a loss at this point.

    The filter works just fine for my normal posts, but not for custom posts.

Viewing 5 replies - 1 through 5 (of 5 total)
  • @sbrajesh

    Participant

    Hi,
    It is a bug with BuddyPress and there is still an open ticket for the purpose.
    You can see the details here

    https://buddypress.trac.wordpress.org/ticket/5087

    and here
    https://buddypress.trac.wordpress.org/ticket/5643

    At the moment, there does not seem to be a solution. The problem is that query variable ‘s’ is used for Normal WordPress search as well as BuddyPress activity search too. So, When BuddyPress activity is set as home page, the wordpress search query( which is like sitename/?s=someterm) is mistaken for BuddyPress activity search and gets handled by BuddyPress causing the trouble.

    It will need some work on the way BuddyPress catches url(I am hoping that). let us hope that it makes to the core soon.

    @bazaarocommunity

    Participant

    That’s really too bad. Looks like it has been moved to a future release instead of 2.2 unfortunately.

    Is there a way to replicate the Activity Loop, Comment Box, etc. on a separate homepage instead of using the ‘Activity Stream’ template?

    For example, the theme I’m using allows me to display the activity loop using shortcode and that doesn’t seem to cause an issue. So, I think if I could build a front-page.php template that performed the activity loop, comments, etc., it would bypass the issue.

    I tried to copy and paste the index.php content from buddypress/activity/ into a front-page.php file, and the formatting didn’t work out because I think all the references rely on the files being located in the original hierarchy.

    @sbrajesh

    Participant

    Hi,
    You are right about creating a home.php or front-page file and putting the content from activity/index.php

    Here are a couple of things that I may suggest to improve it.
    Since you are using the code (which is part of bp-legacy template and most theme include that), you activity/index.php does not have header/footer.
    The easy way is.
    1. copy the page.php from your theme and rename it to home.php
    2. Now look for the section where you see the loop code( something like while(have_posts()) ..etc, replace only that section of code with the the content of actvity/index.php or you can put this line

    
    <?php bp_get_template_part( 'activity/index' ); ?>
    

    It will include the activity loop inside your home page.

    You may want to look for the div/classes that is generated for your post. If you can inject that, it should look fine(as your theme supports bp and they should have the css.

    If it does not work, please post the content of your homepage on pastebin and I will modify it for you 🙂

    @bazaarocommunity

    Participant

    Thanks for the advise. When I do that, it does not load the wall post text box or tabs that are normally found on the activity page. Do I have to copy the entire contents of /activity to my theme root?

    @peter-hamilton

    Participant

    You should copy the entire buddypress folder from the bp-legacy folder to your root anyway, this will allow easy adjustment of those core templates, and you get easier access to those files to copy code for new page-templates you can add to your root folder.

    Perhaps you might have to alter Brajesh Singh’s code to this, not sure.

    <?php bp_get_template_part( 'buddypress/activity/index' ); ?>

    Another way around would be plugins that allow activity as shortcode to be placed on any page, but more plugins is not necessarily a good idea.

    Good luck

    Peter Hamilton
    Onlijn.com

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Activity Stream Homepage Compatibility Issues’ is closed to new replies.
Skip to toolbar