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
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
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