How to add follow functionality to multi-author wordpress site?

is there any way to add “follow” functionality to WordPress ?

so that every logged-in user can follow his favorite author

and only can see post from authors that he followed them ..

A possible solution would be that if a logged-in user (call it user #1) is clicking “follow” on another user’s profile (call it user #2), you record user #2’s ID as meta data on user #1. You can do this via the update_user_meta function. You can then retrieve posts from user #2 by using WP_Query with an author parameter. The author parameter can be an array, so you can get the posts of multiple users that way

and maybe if we make this idea as a function called : “is_followed” which return True and False Then we can use it in index.php page in the following line :

<?php if( have_posts() ) : ?>
    <div class="entries">
        <?php while( have_posts()  ) : the_post(); ?>
            <?php get_template_part( 'content', get_post_format() ); ?>
        <?php endwhile; ?>
<?php endif; ?>

to be something like this:

<?php if( have_posts() ) : ?>
    <div class="entries">
        <?php while( have_posts() & is_followed  ) : the_post(); ?>
            <?php get_template_part( 'content', get_post_format() ); ?>
        <?php endwhile; ?>
<?php endif; ?>

Sorry I don’t know how to write codes 🙁

I found a free plugin called: “User profiles” that can create a profile for each author: https://wordpress.org/plugins/user-profile/ so that we can put the follow button in it :/

2 Answers
2

Might be overkill, but you might want to take a look at BuddyPress – it’s an actively developed project that extends WordPress with social networking features.

Leave a Comment