페이지 제한 작동 안함

안녕하세요 :)

https://hotp.shop/baby/

해당url은 페이지 제한 걸어둔 url입니다.

 

콘솔이든 어디든 찍히면 참 좋을텐데.. 뭐가 안뜨니 어렵네요 ㅠㅠ

 

추가로 페이지는 제가 직접 만들었습니다.

좋은 정보와 인맥을 동시에, 워드프레스 사용자 단톡방 참여하기
좋은 정보와 인맥을 동시에, 워드프레스 사용자 단톡방 참여하기
  • 안녕하세요~^^

    코스모스팜 회원관리 플러그인 관련해서는

    워드프레스 카테고리에 올려주시길 부탁드립니다.

     

    올려주신 내용만으로는 원인을 파악하기 어렵습니다.

    페이지 제한 기능은 the_content 필터를 활용하고 있습니다.

    페이지는 어떻게 만드셨는지 구체적으로 설명 부탁드립니다.

    고맙습니다.

  • <?php
    /*
     * Template Name: 육아/식품
     */
    
    if(!defined('ABSPATH')) exit;
    
    get_header();
    ?>
    
    <main class="main">
    
        <!-- 메인 배너  [template-parts 폴더] 안 에 있음-->
        <?php echo get_template_part('template-parts/main-banner') ?>
    
        <!-- 메인 카테고리  [template-parts 폴더] 안 에 있음-->
        <?php echo get_template_part('template-parts/main-category') ?>
    
        <section class="main-product product-list">
            <ul class="">
                <?php
                /*날짜변수 생성*/
                $today = date("Ymd");
                $today_count = date("Ymd", strtotime($today."-100 day"));
    
                /*조건을 변수에 담음*/
                $args = array(
                    'post_type' => 'product',
                    'posts_per_page' => 200,
                    'product_cat' => 'baby_food',
    
                    'meta_query' => array(
                        'relation' => 'AND',
                            array(
                                'key' => 'start_date',
                                'value' => $today_count,
                                'compare' => '>'
                            )
                        ),
    
                    'orderby' => 'meta_value_num',
                    'order' => 'asc'
    
                );
                $loop = new WP_Query( $args );
    
                while ( $loop->have_posts() ) : $loop->the_post();
                    $full_price = get_post_meta( $post->ID, 'full_price', true );
                    $sale_price = get_post_meta( $post->ID, 'sale_price', true );
                    $brand = get_post_meta( $post->ID, 'brand', true );
                    $margin_percent = get_post_meta( $post->ID, 'margin_percent', true );
                    $count_start = get_post_meta( $post->ID, 'count_start', true );
                    $count_end = get_post_meta( $post->ID, 'count_end', true );
                ?>
    
                <li class="item">
                    <a href="<?php echo the_permalink(); ?>">
                        <div class="thum">
                            <?php the_post_thumbnail('thumbnail'); ?>
                        </div>
                        <div class="info">
                            <strong><?php echo the_title(); ?></strong>
                            <?php echo the_excerpt(); ?>
                            <span class="keyword"><?php echo $brand; ?></span>
                            <span class="price"><small><?php echo number_format($full_price); ?>원</small><em><?php echo number_format($sale_price); ?>원</em></span>
                            <span class="commi">커미션 <?php echo $margin_percent; ?>%</span>
                            <span class="gift"><em><?php echo $count_start; ?></em>/<?php echo $count_end; ?></span>
    
                        </div>
                    </a>
                </li>
                <?php
                endwhile;
    
                wp_reset_postdata();
                ?>
            </ul>
        </section>
    </main>
    <?php
            // 내용 출력
            the_content();
    	?>
    
    <?php
    get_sidebar();
    get_footer();
    ?>

    해당 페이지 소스 전문입니다.

  • 페이지를 템플릿으로 만들었을 때 페이지 제한 기능이

    정상적으로 동작하지 않는다면

    FTP로 접속해서 /wp-content/plugins/cosmosfarm-members/class/Cosmosfarm_Members.class.php 파일에

    아래의 코드를 찾아서

    if(!is_singular() || !in_the_loop() || !is_main_query()){
    	return $content;
    }

    아래의 코드로 교체해보시겠어요?

    if(!is_singular() || !is_main_query()){
    	return $content;
    }

    고맙습니다.

좋은 정보와 인맥을 동시에, 워드프레스 사용자 단톡방 참여하기