WordPress.org

Support

Support » Plugins and Hacks » Gallery by BestWebSoft » [Resolved] How to password protect galleries

[Resolved] How to password protect galleries

Viewing 1 replies (of 1 total)
  • Plugin Author bestwebsoft

    @bestwebsoft

    Hello mzjme,

    You should change the gallery template. Please open the folder with theme, find there the files gallery-single-template.php and gallery-template.php
    for gallery-template.php template, find the lines 75-76 there

    <div><?php echo the_excerpt_max_charlength(100); ?></div>
    <a href="<?php echo $permalink; echo basename( get_permalink(
    $post->ID ) ); ?>"><?php echo $gllr_options["read_more_link_text"];
    ?>

    You should arrange them in the construction of password verification, so that it will be like this:

    <?php if ( post_password_required() ) : ?>
    <div><?php echo the_excerpt_max_charlength(100); ?></div>
    <a href="<?php echo $permalink; echo basename( get_permalink(
    $post->ID ) ); ?>"><?php echo $gllr_options["read_more_link_text"];
    ?>
    <?php endif; ?>

    For the template gallery-single-template.php
    Find the lines 16-72, arrange them in the construction of password verification before the line 16:
    <div class="gallery_box_single">
    Add the line:
    <?php if ( post_password_required() ) : ?>
    So that it will be like this:

    <?php if ( post_password_required() ) : ?>
    <div class="gallery_box_single">

    And after the line 72
    </div>
    Add the line:
    <?php endif; ?>
    So that it will be like this:

    </div>
    <?php endif; ?>
    <div class="clear"></div>

    [Please post code & markup between backticks or use the code button. Your posted code may now have been permanently damaged by the forum’s parser.]

    Kind regards,
    support Team

Viewing 1 replies (of 1 total)
  • The topic ‘[Resolved] How to password protect galleries’ is closed to new replies.
Skip to toolbar