• Resolved janbrokes

    (@janbrokes)


    Hello,
    thank you for your plugin.
    I am trying to hide post custom fields values in single.php, but i still receive that password is wrong.
    Have you any idea, where i do mistake?

    here is my code

                                    <div class="informace">
                                    <p>Hodnocení: <strong><?php $key_name = get_post_custom_values($key = 'ratebeer');echo $key_name[0]; ?></strong></p>
                                    <p>Cena: <strong><?php $key_name = get_post_custom_values($key = 'cena_kc_objem');echo $key_name[0]; ?></strong></p>
                                    <p>Hodnocení: <strong><?php $key_name = get_post_custom_values($key = 'ratebeer');echo $key_name[0]; ?></strong></p>
                                    <p>Cena: <strong><?php $key_name = get_post_custom_values($key = 'cena_kc_objem');echo $key_name[0]; ?></strong></p>
    
                                    <?php 
                                    ob_start();
                                    ?>
                                    <p>Hidden content</p>
                                    <p>Hodnocení: <strong><?php $key_name = get_post_custom_values($key = 'ratebeer');echo $key_name[0]; ?></strong></p>
                                    <p>Cena: <strong><?php $key_name = get_post_custom_values($key = 'cena_kc_objem');echo $key_name[0]; ?></strong></p>
    
                                    <?php $content = ob_get_clean();?>
    
                                    <?php echo do_shortcode('[ppwp passwords="test"]'.$content.'[/ppwp]'); ?>	
    
                                    </div>

    thank you

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author WP Folio

    (@buildwps)

    Hi @janbrokes,

    Thanks for reaching out to us.

    To assist you better, might we know:

    • Are you using our PPWP Lite or Pro version?
    • Which theme are you using?
    • Do you use any plugin to create the custom fields?

    Please refer to our documentation on how to protect ACF custom field values.

    You might want to drop an email at hello(at)preventdirectaccess.com for faster assistance.

    We look forward to your reply.

    • This reply was modified 3 years, 10 months ago by WP Folio.
    Thread Starter janbrokes

    (@janbrokes)

    Hello,
    1) lite version
    2) Divi (but not using divibuilder for post content – i do customization via single.php
    3) Advanced custom field.
    Thanks for any idea how to update me code above (1st comment)

    Plugin Author WP Folio

    (@buildwps)

    Thanks for your reply, @janbrokes.

    First of all, custom field protection is an advanced feature available on PPWP Pro version only.

    Secondly, if you’re using ACF, you should use WYSIWYG editor and wrap the protected section with our ppwp shortcode.

    Finally, you should display the field on your content using our custom code as below.

    <?php
    // Change "field-name" to your custom field name
    echo '<div class="ppwp-is-custom-field" ppwp-data-mt="field-name">';
    
    foreach( get_post_meta( get_the_ID(), 'field-name' ) as $meta_data ) {
        echo do_shortcode( $meta_data );
    }
    echo '</div>';
    ?>

    As you can see from the code, our plugin protects a section based on content ID or field ID.

    Without this piece of information, we can’t compare the correct password and unlock the protected section properly.

    As a result, even though the password form is shown, you will receive an incorrect password message all the time.

    Let us know if it makes sense to you.

    • This reply was modified 3 years, 10 months ago by WP Folio.
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘wrong password’ is closed to new replies.