• Resolved darkvue

    (@darkvue)


    I am trying to build a basic paysite. I am having NO problems restricting content but, I’m having issues with it being too strict. I have thumbnails of all my galleries on my home page. You click them and it takes you to the corresponding gallery. I want visitors to be able to see these thumbnails but be denied when they click one of the thumbs (galleries). I can’t seem to get this figured out. It either completely blocks all the content or blocks nothing.
    I was looking at the URL groups feature but have not got it to perform as needed but I have a question. ALL of my post have a URL that starts like this
    [NSFW]

    http://sexxxyteengirls.com/2015/

    Would it be possible to use the URL group to block any of the links that include the “/2015” directory?

    https://ww.wp.xz.cn/plugins/membership/

Viewing 1 replies (of 1 total)
  • Plugin Support Predrag – WPMU DEV Support

    (@wpmudev-support1)

    Hi @darkvue,

    Thank you for your question.

    FYI your site contain content that is not suitable for a general audience or for viewing whilst at work. To avoid creating problems for anyone who is trying to help you, please add NSFW to either the topic title or the content of your post, as well as tag your post NSFW, as a warning if you think your site falls into this category. (Otherwise your post / links may be removed.)

    NSFW stands for Not Safe For Work.

    Find more information about it on the following WordPress forum welcome page.

    http://codex.ww.wp.xz.cn/Forum_Welcome#Warn_About_Adult_Content

    I have thumbnails of all my galleries on my home page. You click them and it takes you to the corresponding gallery. I want visitors to be able to see these thumbnails but be denied when they click one of the thumbs (galleries)

    I have achieved this on my test site using default WordPress Twenty Twelve theme.

    I have added the following code in the functions.php file of my child theme.

    add_filter( 'the_content', 'my_the_content_filter', 20 );
    
    function my_the_content_filter( $content ) {
    	if( !is_user_logged_in() && is_attachment() ){
    		$content = __('The content is only accessible for logged in users.', 'themetextdomain');
    	}
    
    	return $content;
    }

    Then copied the image.php file from parent theme in to child theme and made the following changes in it.

    Before Editing :

    $attachment_size = apply_filters( 'twentytwelve_attachment_size', array( 960, 960 ) );
    echo wp_get_attachment_image( $post->ID, $attachment_size );

    After Editing :

    if( is_user_logged_in() ){
    $attachment_size = apply_filters( 'twentytwelve_attachment_size', array( 960, 960 ) );
    echo wp_get_attachment_image( $post->ID, $attachment_size );
    }

    Could you please try achieving it by making the following changes in your child theme?

    Information about child theme:
    http://premium.wpmudev.org/blog/how-to-create-wordpress-child-theme/
    http://codex.ww.wp.xz.cn/Child_Themes

    Best Regards,
    Vinod Dalvi

Viewing 1 replies (of 1 total)

The topic ‘[NSFW] I need help’ is closed to new replies.