-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpage-partner.php
More file actions
83 lines (74 loc) · 2.96 KB
/
page-partner.php
File metadata and controls
83 lines (74 loc) · 2.96 KB
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
<?php
/**
* Template Name: Partners
*/
get_header(); ?>
<?php
$page = get_queried_object();
$ID = $page->ID;
$title = $page->post_title;
$sub_title = get_post_meta($ID, 'page_subtitle', true);
if ($sub_title){
echo'<section id="title" class="emerald-home"><div class="container"><div class="row"><div class="col-sm-12"><p>'.$sub_title.'</p></div></div></div></section>';
}
?>
<section id="partner-content" class="white-box">
<div class="container">
<div class="row">
<div class="col-sm-12">
<?php
$queryObject = new WP_Query( 'post_type=partner&posts_per_page=-1&orderby=date&order=DESC' );
// The Loop!
if ($queryObject->have_posts()) {
?>
<?php
while ($queryObject->have_posts()) {
$queryObject->the_post();
?>
<div class="col-sm-6">
<div class="col-sm-10 center partner" style="margin: auto; float: none;">
<a href="<?php echo get_post_meta($queryObject->post->ID, 'link', true) ?>"><div class="member"><?php the_post_thumbnail('medium'); ?></div></a>
<div class="more-less">
<div class="more-block" style="height: 80px; overflow: hidden;">
<?php the_content(); ?>
</div>
</div>
</div>
</div>
<?php
}
?>
<?php
}
?>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js" type="text/javascript"></script>
<script type="text/javascript">
$(function(){
// The height of the content block when it's not expanded
var adjustheight = 95;
// The "more" link text
var moreText = "[ More ]";
// The "less" link text
var lessText = "[ Less ]";
// Sets the .more-block div to the specified height and hides any content that overflows
$(".more-less .more-block").css('height', adjustheight).css('overflow', 'hidden');
// The section added to the bottom of the "more-less" div
$(".more-less").append('<span class="button-content"><a href="#" class="adjust more"></a></span>');
$("a.adjust").text(moreText);
$(".adjust").toggle(function() {
$(this).parents("div:first").find(".more-block").css('height', 'auto').css('overflow', 'visible');
// Hide the [...] when expanded
$(this).parents("div:first").find("p.continued").css('display', 'none');
$(this).text(lessText);
}, function() {
$(this).parents("div:first").find(".more-block").css('height', adjustheight).css('overflow', 'hidden');
$(this).parents("div:first").find("p.continued").css('display', 'block');
$(this).text(moreText);
});
});
</script>
</div>
</div>
</div>
</section>
<?php get_footer();