• Resolved Miioff

    (@miioff)


    Hi!

    I would like to use a plugin called “Zip Attachments” on my site (kuvat.kosloff.me), and it works perfectly with normal posts (for example this post), but if I use galleries within the posts it wont work (this post). Instead of a working zip-file, I get only an empty zip, which transfers into a cgpz-file, when trying to extract it.

    Do you have any ideas how to get the plugin work with galleries also?

    Thanks
    Miioff

    https://ww.wp.xz.cn/plugins/zip-attachments/

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Ricard Torres

    (@quicoto)

    Hi there,

    Are the photos from the gallery post actually attached to that post? They must be attached to the same post.

    Let me know 🙂

    Rick

    Thread Starter Miioff

    (@miioff)

    Oh true! They aren’t!
    I just had to attach them to the posts and now it works! Thanx!

    I have another problem too. I want to show the link only in posts, never in the pages. So now my content-single.php looks like this:

    <?php
    /**
     * The template used for displaying page content in page.php
     *
     * @package ThemeGrill
     * @subpackage Accelerate
     * @since Accelerate 1.0
     */
    ?>
    
    <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
    	<?php do_action( 'accelerate_before_post_content' ); ?>
    
    	<header class="entry-header">
    		<h1 class="entry-title">
    			<?php the_title(); ?>
    		</h1>
    	</header>
    
    	<?php accelerate_entry_meta(); ?>
    <?=function_exists('za_show_button') ? za_show_button("Download photos") : ’’?>
    
    	<div class="entry-content clearfix">
    		<?php
    			the_content();
    			wp_link_pages( array(
    				'before'            => '<div style="clear: both;"></div><div class="pagination 	clearfix">'.__( 'Pages:', 'accelerate' ),
    				'after'             => '</div>',
    				'link_before'       => '<span>',
    				'link_after'        => '</span>'
    	      ) );
    
    		?>
    
    	</div>
    
    	<?php do_action( 'accelerate_after_post_content' ); ?>
    </article>

    But unfortunately most of my posts are protected with password, and now you can still download the photos even if you don’t know the password. (Look at this post.)
    So I want to show the download link only in the posts and only if you know the password.

    Is it possible? 🙂

    Miika

    Plugin Author Ricard Torres

    (@quicoto)

    Yes you can! Use WordPress Conditional Tags http://codex.ww.wp.xz.cn/Conditional_Tags

    Try using a negative ! is_page http://codex.ww.wp.xz.cn/Function_Reference/is_page

    Something like:

    if ( !is_page() ){
    // Will not run on pages
    }

    Also, for the protected password posts.. Maybe you can try to use this snippet in your functions.php instead and work from there (using Conditional Tags if you need to):

    function za_button_print($content)
    {
        return $content.za_show_button('Download');
    }
    add_filter('the_content', 'za_button_print');

    Let me know if this helps!

    Rick

    Thread Starter Miioff

    (@miioff)

    Perfect!

    I just needed to replace a bit of my old code with this this:

    <?php if ( !post_password_required() ) : ?>
    
    	<?=function_exists('za_show_button') ? za_show_button("Download photos") : ’’?>
    
    <?php endif;?>

    in the content-single.php -file and now it works!

    Thanx a lot! 🙂
    Miika

    Plugin Author Ricard Torres

    (@quicoto)

    You’re welcome Miika.

    Would you mind leaving a review of the plugin? 🙂

    http://ww.wp.xz.cn/support/view/plugin-reviews/zip-attachments

    Thank you,

    Rick

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Zip Attachments with galleries’ is closed to new replies.