BuddyDev

Search

BuddyBlog Pro Posts Layout – 2

  • Participant
    Level: Master
    Posts: 279
    NikB on #46992

    Hi again Brajesh

    Sorry to trouble you again but further to my previous post (https://buddydev.com/support/forums/topic/buddyblog-pro-posts-layout/) could you possibly clarify what should be the paths for the BuddyBlog Pro templates in my child theme for a custom post type (events) – for both individual and group posts – if using the BuddyBoss theme?

    I think it’s possibly the “default” folders that are confusing me but I’ve tried all the combinations I can think of and still haven’t hit on the correct permutation.

    With many thanks as always.
    Nik

  • Keymaster
    (BuddyDev Team)
    Posts: 24706
    Brajesh Singh on #46997

    Hi Nik,
    I am sorry for the confusion.
    Here is a screenshot from the child theme showing how to override templates for events post type(I only created posts.php). You can create others as you need them.

    https://i.ibb.co/x87dfzN/Selection-002.png

    Regards
    Brajesh

  • Participant
    Level: Master
    Posts: 279
    NikB on #47000

    Hi Brajesh

    Thank you so much… that must have been about the only combination I didn’t try(!) but I’m pleased to say that part is working now.

    It has however highlighted another issue…

    Despite the fact that I have enabled “Should tab post lists show only the posts created by BuddyBlog(front end)?”, the events tab on individual profiles is showing ALL events by that user (including events created through the dashboard) and the events tab on group profiles is also showing ALL events by that user (including events created through the dashboard AND non-group events).

    I’m using the Events Manager plugin and I’m guessing this is because it is somehow overriding the posts queries. I note that in posts.php, you have a line as follows –

    remove_filter( ‘the_content’, ‘bp_replace_the_content’ );

    Would I be right in thinking that I somehow need to track down whatever filter the Events Manager plugin is applying and remove that too?

    With many thanks in advance for your thoughts.
    Nik

  • Keymaster
    (BuddyDev Team)
    Posts: 24706
    Brajesh Singh on #47001

    Hi Nik,
    Thank you for the reply.
    I am glad the template part is working.

    There is something overriding your query args. The most probably reason is a plugin direct filtering on posts sql or using pre_get_post to modify the query. I will suggest looking into it.

    
    remove_filter( 'the_content', 'bp_replace_the_content' );
    

    Was used to make sure BuddyPress/BuddyBoss does not try to replace the content inside posts as the profile of user. The output their profile data using the same.

    Regards
    Brajesh

  • Participant
    Level: Master
    Posts: 279
    NikB on #47003

    Hi Brajesh

    Thank you and yes that makes sense.

    I already know the Events Manager plugin was influencing the results as initially it was set to only show “past events” and since I didn’t have any, nothing was showing up at all… having fixed that part (which was simply the matter of a setting in the dashboard), I’ll investigate a bit further and hopefully can find a way to override the EM filter more fully in the template.

    Regards
    Nik

  • Keymaster
    (BuddyDev Team)
    Posts: 24706
    Brajesh Singh on #47009

    Hi Nik,
    Thank you.

    Please do let me know if you were able to troubleshoot it?

    Regards
    Brajesh

  • Participant
    Level: Master
    Posts: 279
    NikB on #47012

    Hi Brajesh

    For now at least, I have solved this by adding the following to my functions.php –

    remove_action(‘parse_query’, array(‘EM_Event_Post’,’parse_query’));

    … this seems to work, at least from testing so far but I have yet to fully explore whether it may have an unwanted knock on effect elsewhere. (Note: I would have preferred to run the remove action in the BuddyBlog templates themselves but that didn’t work, presumably because it’s running too late in the process.)

    Hope this is of interest and I’ll update if/when I discover anything further.

    Regards
    Nik

    PS. Once complete, I’d also be more than happy to share the additional steps I’ve taken to integrate the Event Manager plugin with BuddyBlog Pro if it might be of interest. As you’re aware, there are still a few tweaks to address but, thanks to your assistance, it certainly seems to be heading in the right direction now.

  • Participant
    Level: Master
    Posts: 279
    NikB on #47058

    Hi again Brajesh

    The problem: when using BuddyBlog Groups with the Events Manager plugin, both group AND personal events are displayed in the group event tab. Presumably because the EM plugin is overriding BuddyBlog Groups filters.

    The issue can be fixed by including

    remove_action(‘parse_query’, array(‘EM_Event_Post’,’parse_query’));

    in my functions.php however, I am concerned that this might have unexpected results elsewhere in the site so thought it might be safer to edit my posts.php template instead.

    I have tried replacing…

    `query_posts(
    bblgroups_get_posts_query_args(
    array(
    ‘post_type’ => bblpro_get_current_post_type(),
    )
    )
    ); `

    with

    `query_posts(
    bblgroups_get_posts_query_args(
    array(
    ‘post_type’ => bblpro_get_current_post_type(),
    ‘meta_query’ => array(‘relation’ => ‘AND’,
    array(
    ‘key’ => ‘_bblgroups_group_id’,
    ‘compare’ => ‘=’,
    ‘value’ => bp_get_current_group_id(),
    ),
    )
    )
    )
    ); `

    … but the meta_query doesn’t seem to be being taken into account. Not sure if it’s my code or just the wrong approach but if you do happen to have time to make any suggestions, they would be very much appreciated.

    With many thanks in advance.
    Nik

  • Keymaster
    (BuddyDev Team)
    Posts: 24706
    Brajesh Singh on #47059

    Hi Nik,
    I will be glad to look into the Event Manager after Diwali(It’s on 24th here) and assit you with it.

    Using

    
    remove_action( 'parse_query', array( 'EM_Event_Post', 'parse_query' ) );
    

    Without scoping is not suggested at all. It is bound to have conflict.

    Regards
    Brajesh

  • Participant
    Level: Master
    Posts: 279
    NikB on #47067

    Hi Brajesh

    Thank you for confirming my concerns with regard to removing the parse_query. Events Manager seems to come with quite a complex range of filters which may perhaps provide a clue with regard to the best way to handle things but if/when you have the time, any assistance would be very much appreciated.

    Wishing you and yours a very happy Diwali and will look forward to hearing from you in due course.

    Regards
    Nik

You must be logged in to reply to this topic.

This topic is: not resolved