• Im using a front end post plugin where users can post directly from front page.
    I want to limit users from posting more then 5 posts but i dont know how to.

    I want something backend so it works with the front end post plugin. So i can place the code inside the plugin.

    When users tries to post his 6 post it will redirect or give an error message saying you reached maximum post limit or something.

    I have tryied limit post plugin and it didnt work: https://wordpress.org/plugins/limit-posts/

Viewing 6 replies - 1 through 6 (of 6 total)
  • Moderator Steven Stern (sterndata)

    (@sterndata)

    Volunteer Forum Moderator

    >> Im using a front end post plugin <<

    Which one? Check with its developers as there may be hooks you can use to modify its behavior.

    Thread Starter Gustav

    (@4ever16)

    Im using djd-site-post plugin: https://wordpress.org/plugins/djd-site-post/
    It doesnt have support anymore.

    Moderator Steven Stern (sterndata)

    (@sterndata)

    Volunteer Forum Moderator

    and it hasn’t been indexed by hookr.io http://hookr.io/plugins/#index=d

    That plugin is over 5 years out of date. You really should look into using something else.

    If you want to keep using it, you’ll have to modify its code to get a number of posts by the author and logic to decide what to do when the count exceeds your limit.

    Thread Starter Gustav

    (@4ever16)

    Ok still not solving it.

    So lets think.

    Get user post count.
    If user post count 100
    Do this
    else
    Do this

    Moderator Steven Stern (sterndata)

    (@sterndata)

    Volunteer Forum Moderator

    That’s pretty much it

    But I’d look for a different plugin for front end posting, one that has support.

    Thread Starter Gustav

    (@4ever16)

    Ok so i put this code in the front end plugin and it shows correct.

    If i have more then 10 posts it shows >10.
    If less then 10 posts it shows <10.

    Maybe i can come around this in some one?
    Does someone has an idea?
    Like if >10 hide widget.

    <?php
    $count = count_user_posts( $current_user->ID );
    $current_user = wp_get_current_user();
    
    if ( $count >= 10) {
    
        echo ">10";
    
    } else {
    
        echo "<10";
    
    }
    ?>
Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘Max post per user’ is closed to new replies.