Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter Jeff Cohan

    (@jdcohan)

    If there’s no UM function, I could always use conditionals like this:

    <?php if ( !is_user_logged_in() && current_user_can($capability) ) : ?>
    
    <?php else: ?>
    
    <?php endif; ?>

    …where $capability is replaced by the capability associated with authorized members.

    Plugin Contributor Champ Camba

    (@champsupertramp)

    Hi,

    I added new action hooks so you can customize the options of custom access settings.

    https://github.com/ultimatemember/ultimatemember/commit/87917048885b1a75bb06c8e52decaf4b4428f43a

    This will be added on the next release.

    Regards,

    Thread Starter Jeff Cohan

    (@jdcohan)

    Thanks, @camp. I’ll look for that.

    Thread Starter Jeff Cohan

    (@jdcohan)

    @camp (or anyone) –

    Could you give a simple example of how to use this hook to – for example – display a “not authorized” message on a month archive page and hide everything else (featured image, title, author/tax meta info, and content)?

    I did some testing with a function (hooked into um_access_post_type) that tests for the value of $current_page_type and does an add_filter() for ‘the_content’ if ‘month’ == $current_page_type. However, this (a) shows the message for each post in the loop and (b) doesn’t distinguish between logged_in and logged_out members.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘How to control access to blog archive pages’ is closed to new replies.