• Resolved psn

    (@psn)


    Hi,

    I have looked into your plugin again but if I understand the exclusion from home page of blog is not any function today as I can see all excluded post in the excluded category and the restriction is only happen when a not logged in user click on the title of the post then redirection to login happens. I have seen some threads that you are working on this matter and this would be a very great feature.

    If I have misunderstand this, please advice.

    Per

Viewing 14 replies - 1 through 14 (of 14 total)
  • Plugin Author Joachim Jensen

    (@intoxstudio)

    Yes, currently Restrict User Access still doesn’t support this feature, but I am working on implementing it. It will require a lot of changes in the backend, so I have unfortunately no ETA on it yet.

    Thread Starter psn

    (@psn)

    Hi,

    Any ETA for the above feature?

    Per

    Plugin Author Joachim Jensen

    (@intoxstudio)

    Unfortunately still no ETA on this feature.

    If you only restrict by posts/pages, you can use this code to hide them from any custom list on the site:

    add_action( 'pre_get_posts', function($query) {
    	if (!is_admin() && !$query->is_singular() && (!isset($query->query["post_type"]) || $query->query["post_type"] != RUA_App::TYPE_RESTRICT)) {
    		global $wpdb;
    		$other_levels = array_diff(
    			array_keys(RUA_App::instance()->get_levels()),
    			RUA_App::instance()->level_manager->get_user_levels()
    		);
    		$result = $wpdb->get_col("SELECT m.meta_value FROM $wpdb->postmeta m INNER JOIN $wpdb->posts p ON m.post_id = p.ID WHERE m.meta_key = '_ca_post_type' AND p.post_parent IN ('".implode("','", $other_levels)."')");
    		if($result) {
    			$query->set('post__not_in', $result);
    		}
    	}
    	return $query;
    } );
    Thread Starter psn

    (@psn)

    Hi

    In which file should we place the above code? Also where in file?

    Will test this asap we get your answer about this.

    Thread Starter psn

    (@psn)

    Hi

    Tested to insert above code into our themes function.php file but that didn’t work. So I assume we need to add this into some of your plugin files?

    Thread Starter psn

    (@psn)

    Just fyi we have our site structure with a static start page and a blog page. Don’t know if this has any impact for the above code. But reply asa you can where to put the code so we can test if this will work.

    Per

    Thread Starter psn

    (@psn)

    Need info where to apply above code.

    Per

    Plugin Author Joachim Jensen

    (@intoxstudio)

    You can drop the code in any file, but functions.php in your theme would be preferable. It will only work for conditions where you have selected posts and pages, not for categories, and not for negated conditions.

    Let me know if this answers your question.

    Thread Starter psn

    (@psn)

    Ok that explain why its not working as we have to much of post in the 2 members categories and we can’t handle to exclude each of them. I hope you will have a solution soon so all of post connected to a certain categories will be hidden from the blog page.

    Any ETA for this feature?

    Per

    • This reply was modified 7 years, 10 months ago by psn.
    Plugin Author Joachim Jensen

    (@intoxstudio)

    Unfortunately I do not have any ETA on this feature, I am still planning how to implement it properly and efficiently, but as this plugin is developed in my spare time, I do currently not have much time for it.

    Thread Starter psn

    (@psn)

    Hi Joachim,

    Any progress on the above mentioned feature?

    Per

    Thread Starter psn

    (@psn)

    Hi

    Any ETA on above?

    Per

    Plugin Author Joachim Jensen

    (@intoxstudio)

    Unfortunately no ETA on this yet as I simply haven’t had time to implement it yet.

    Thread Starter psn

    (@psn)

    Hi Joachim, do you have any plan to get this feature done this year?

    Per

Viewing 14 replies - 1 through 14 (of 14 total)
  • The topic ‘Exclude from home page’ is closed to new replies.