-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathcategory-code.php
44 lines (31 loc) · 1.06 KB
/
category-code.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
<?php get_header(); ?>
<div class="container">
<div class="row">
<div class="col-lg-8 col-lg-offset-2 col-xs-12">
<h1 style="margin-bottom: 40px">Open Source Code</h1>
<?php while ( have_posts() ) : the_post(); ?>
<?php
$url = get_post_meta($post->ID, 'url', true);
$download = get_post_meta($post->ID, 'download', true);
$arr = explode('/', $download);
$filename = $arr[count($arr)-1];
?>
<div class="post" style="padding-bottom: 20px">
<h2><?php the_title(); ?></h2>
<?php the_content(); ?>
<div class="btn-group">
<a class="btn btn-primary" href="<?php echo $url; ?>">Project Details</a>
<a class="btn btn-success" href="<?php echo $download; ?>">Download</a>
</div>
</div>
<?php endwhile; ?>
<?php if ($wp_query->max_num_pages > 1): ?>
<ul class="pager">
<li class="previous"><?php next_posts_link('← Older posts'); ?></li>
<li class="next"><?php previous_posts_link('Newer posts →'); ?></li>
</ul>
<?php endif; ?>
</div>
</div>
</div>
<?php get_footer(); ?>