BuddyDev

Search

[Resolved] BP Simple Front End Post Form


  • Participant
    Level: Enlightened
    Posts: 79
    Leo on #3424

    Hi Ravi,

    Thank you, I had already done that, what I was asking was the number of posts that you can see next to BubbyBlog Tab in user profile tabs.

    Check this image please http://i.imgur.com/4VooYU6.jpg

    Thank you,
    Leo


  • Keymaster
    Level: Guru
    (BuddyDev Team)
    Posts: 889
    Ravi on #3425

    Hi Leo

    Please clone the latest code for buddyblog form the following link ‘https://github.com/sbrajesh/buddyblog’ and after cloning the latest code then try the following code in your bp-custom.php file

    
    add_filter( 'buddyblog_visible_posts_count', 'buddyblog_visible_count', 10, 2 );
    function buddyblog_visible_count( $total_posts, $user_id ) {
       
        $query_args = array(
    	'author'        => $user_id,
    	'post_type'     => buddyblog_get_posttype(),
    	'post_status'   => $status,
            'category__in'  => array(65), //category ids
    	'fields'         => 'ids',
            'suppress_filters' => false
        );
        $posts = new WP_Query( $query_args );
        
        $total_posts = $posts->found_posts;
        
        return intval( $total_posts );
        
    }
    

    Thank You
    Ravi


  • Keymaster
    Level: Guru
    (BuddyDev Team)
    Posts: 889
    Ravi on #3426

    Hi Leo

    Please download form this repositery.

    https://github.com/sbrajesh/buddyblog

    Thank You
    Ravi


  • Participant
    Level: Enlightened
    Posts: 79
    Leo on #3427

    Hi Ravi,
    Thank you, will try it and let you know.

    Thanks,
    Leo


  • Participant
    Level: Enlightened
    Posts: 79
    Leo on #3434

    Hi Ravi,

    All works perfect, I just needed to change ‘suppress_filters’ => false to true to add the number of not translated posts too.

    Thank you,
    Leo


  • Keymaster
    Level: Guru
    (BuddyDev Team)
    Posts: 889
    Ravi on #3435

    Hi Leo,

    Thank You for confirming. I am glad that i could help.

    Thank You
    Ravi


  • Participant
    Level: Enlightened
    Posts: 79
    Leo on #3482

    Hello Ravi,

    I am back again, there’s another problem here. Can you please have a look?

    When you publish a post (all works well here), the post is published under the category 65. I have a loop to show only these posts there.
    Later if you want to edit the post, opens the url like this: site.com/members/member-name/buddyblog/edit/
    like the general posts from buddyblog published under another category.
    The problem is when you make the changes and submit the form, the post changes the category and it is being listed in the main loop.

    Is there any way to open another form for editing the post, the same form that we use to publish it?

    Thank you,
    Leo


  • Keymaster
    Level: Guru
    (BuddyDev Team)
    Posts: 889
    Ravi on #3484

    Hi Leo,

    Welcome back. I will get back to you shortly on this.

    Thank You
    Ravi


  • Keymaster
    Level: Guru
    (BuddyDev Team)
    Posts: 889
    Ravi on #3493

    Hi Leo,

    I am Sorry for the delayed reply.
    Most probably the BuddyBlog settings are conflicting with our custom code(single we are using the BuddyBlog edit form to update).

    We will need to use a different edit/add new form. So, you will need to add an endpoint for that. Do you want me to provide code for it ?

    Thank you
    Ravi


  • Participant
    Level: Enlightened
    Posts: 79
    Leo on #3494
    This reply has been marked as private.

The topic ‘ [Resolved] BP Simple Front End Post Form’ is closed to new replies.

This topic is: resolved
Subscribe