The Support Forums will be in read-only mode for a scheduled maintenance window on 01 September 2016 14:00 UTC - 20:00 UTC. More information.

Need a little help with this code (force login) (1 post)

  1. yortem
    Posted 2 years ago #

    i have this code that force id post to login.

    function my_force_login() {
    global $post;
    if (!is_single()) return;
    $ids = array(188, 185, 171); // array of post IDs that force login to read
    if (in_array((int)$post->ID, $ids) && !is_user_logged_in()) {

    how i can i change this instead of 188,185,171 - to all ids that i have in my site? or all posts from category?

Topic Closed

This topic has been closed to new replies.

About this Topic