Skip to:
Content
Pages
Categories
Search
Top
Bottom

Help to put Favorit button in blog post page


  • rosyteddy
    Participant

    @rosyteddy

    buddypics\includes\templates\album\comments.php
    uses this code to show Fav/Unfav button in the post page itself
    so that Fav/Unfav can be done like a 2-way switch from
    both stream and content page

    
    <?php if ( is_user_logged_in() ) : ?>
    <?php if ( !bp_get_activity_is_favorite() ) : ?>
    <a href="<?php bp_activity_favorite_link(); ?>" class="fav" title="<?php _e( 'Mark as Favorite', 'buddypress' ) ?>">
    <?php _e( 'Favorite', 'buddypress' ) ?></a>
    <?php else : ?>
    <a href="<?php bp_activity_unfavorite_link(); ?>" class="unfav" title="<?php _e( 'Remove Favorite', 'buddypress' ) ?>"><?php _e( 'Remove Favorite', 'buddypress' ) ?></a>
    <?php endif; ?>
    <?php endif;?>

    However when I put this code in template for blog posts
    so that the same can be done for blog posts
    the number is missing, and thus the Fav/Unfav button shows but fails to work.

    What am I doing wrong? Any code help, please?

    Thanks

    cc @henrywright @danbp

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

  • danbp
    Participant

    @danbp

    @rosyteddy, What am I doing wrong? Apparently nothing. You try do add it to a plugin template.

    If it doesn’t work, maybe it is not intended for or buddypics is not activated. And for the right answer to this, the code author is @modemlooper.

    Ask on plugin support.


    rosyteddy
    Participant

    @rosyteddy

    Hi @danbp

    This is working perfectly for Buddypics.
    I was wondering if it works for Buddypics why it will not work for Blog posts.
    So I tried putting the code – it shows Favorit link below blog post but it does not work as it misses a number. If this can be made to work, you can favorit a blog post from both activity stream and the blog post itself just like comments .

    (BTW @modemlooper seems to be not in this forum these days, same about @imath)

    Thanks.


    danbp
    Participant

    @danbp

    See WP Favorite Post plugin and this topic on how you can do that.
    Needs medium php level.


    modemlooper
    Moderator

    @modemlooper

    The code above is only for activity stream, try another plugin https://wordpress.org/plugins/buddypress-like/


    rosyteddy
    Participant

    @rosyteddy

    @modemlooper – In Buddypics users can Favorit a photo in the photo page itself as well as in the Activity stream. If you Favorit in any of these two places it is updated in the other.
    If you unfavorite in one place it is updated in the other too.

    This is how it should work, and it does work in that way. Members remain eternally confused what they can do on the photo page, why they cannot do it on the blog post page.

    buddypress-like do not have this 2-way liking.

    Thanks 🙂


    modemlooper
    Moderator

    @modemlooper

    post on support forum for like plugin and ask developer to add that feature


    disha76
    Participant

    @disha76

    I am also suffering from this issue.


    @modemlooper
    it was posted in support forum / github of almost all Like and similar plugins long long ago by many users. No response.

    Buddypress core via trac was also requested / issue submitted to make the “Favorit” logical like comments – if you can comment both ways, favorit should also be like that. Isn’t it ? But this has been indefinitely postponed.

    Jetpack Like team was requested because they have the “power and punch” – but there also nothing happened.

    True – only Buddypics does Favoriting both ways.


    danbp
    Participant

    @danbp

    Just to let you know there is a new plugin (since 2015-3-29) which comes with an API who let you handle any post type. See Favorites.
    Maybe you can built something with it.


    disha76
    Participant

    @disha76

    The above plugin has no sync with buddypress activity stream.
    It also does not show who has favorited a post (compare Jetpack Likes)
    Thanks for the news.


    mcpeanut
    Participant

    @mcpeanut

    I have posted in the new favorites plugin support asking if the dev could possibly consider adding native support for buddypress here, i suggest others add to it and the dev may respond positively and look into it, who knows… maybe worth a shot https://wordpress.org/support/topic/buddypress-92?replies=1#post-6781081


    rosyteddy
    Participant

    @rosyteddy

    +1 @mcpeanut
    Posted there.

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘Help to put Favorit button in blog post page’ is closed to new replies.
Skip to toolbar