Forums
Home / Plugin: Lana Downloads Manager / List of downloads
(@vrotmanh)
7 years, 11 months ago
I am trying to make a page with a list of downloads, but I don`t know how to filter or choose to show downloads. Can you help me?
(@lanadesign)
I try to help.
Lana Download is a post type. Post type: ‘lana-download’
How to Create a Custom Post Types Archive Page in WordPress
You have to make archive page in theme. So create archive-lana-download.php and add post list php code.
Example: /wp-content/{theme}/archive-lana-download.php
<?php get_header(); if(have_posts()) : while(have_posts()) : the_post(); ?> <?php the_title(); ?> <div class="entry-content"> <?php the_content(); ?> </div> <?php endwhile; endif; get_footer(); ?>
Thanks!, that was very helpful. I have another problem now, when I click some archive it said “No download_id defined”. I want to click the archive and start downloading it. Thanks again!
Maybe:
<?php if ( function_exists( 'lana_downloads_manager_get_download_url' ) ): ?> <a href="<?php echo esc_attr( lana_downloads_manager_get_download_url( get_the_ID() ) ); ?>">Download</a> <?php endif; ?>
So lana_downloads_manager_get_download_url() function return the download id, first param the post id.
lana_downloads_manager_get_download_url()
I’m not sure, try it, let me know if it does not work. ??