File tree Expand file tree Collapse file tree 2 files changed +47
-14
lines changed Expand file tree Collapse file tree 2 files changed +47
-14
lines changed Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ add_filter ( 'the_content ' , function ( $ content ) {
4
+ $ memberPos = strpos ( $ content , '<!--corporate-members--> ' );
5
+ if ( $ memberPos === false ) {
6
+ return $ content ;
7
+ }
8
+
9
+ $ members = json_decode ( file_get_contents ( GW_RESOURCE_DIR . '/corporate-members.json ' ), true );
10
+ shuffle ( $ members );
11
+
12
+ $ memberContent = '<ul class="row" id="corporate-members"> ' ;
13
+ foreach ( $ members as $ index => $ member ) {
14
+
15
+ // Only show four members at a time
16
+ if ( $ index >= 4 ) {
17
+ break ;
18
+ }
19
+
20
+ $ logoUrl = "//jquery.org/resources/members/ " .
21
+ preg_replace ( '/[^a-z0-9]/ ' , '' , strtolower ( $ member [ 'name ' ] ) ) . ".png " ;
22
+ $ memberContent .=
23
+ '<li class="three columns"> ' .
24
+ '<a href=" ' . $ member [ 'url ' ] . '"> ' .
25
+ '<span></span> ' .
26
+ '<img src=" ' . $ logoUrl . '"> ' .
27
+ '</a> ' .
28
+ '</li> ' ;
29
+ }
30
+ $ memberContent .= '</ul> ' ;
31
+
32
+ return str_replace ( '<!--corporate-members--> ' , $ memberContent , $ content );
33
+ } );
34
+
35
+ ?>
Original file line number Diff line number Diff line change 130
130
}
131
131
}
132
132
133
- # content # whos-using li {
133
+ # content # corporate-members li {
134
134
background : none;
135
+ height : 150px ;
135
136
}
136
137
137
- # whos-using li a {
138
- background : url ('i/whos-using-sprite.png' ) 0px 0px no-repeat;
139
- display : block;
140
- height : 80px ;
141
- text-indent : -9999px ;
142
- }
143
-
144
- # whos-using li a .mediatemple {
145
- background-position : 0 -80px ;
138
+ # corporate-members span {
139
+ display : inline-block;
140
+ height : 100% ;
141
+ vertical-align : middle;
146
142
}
147
143
148
- # whos-using li a .maxcdn {
149
- background-position : 0 -160px ;
144
+ # corporate-members a {
145
+ float : left;
146
+ height : 100% ;
150
147
}
151
148
152
- # whos-using li a .wikipedia {
153
- background-position : 0 -240px ;
149
+ # corporate-members img {
150
+ vertical-align : middle;
151
+ max-height : 150px ;
154
152
}
155
153
156
154
/* Project Tiles */
You can’t perform that action at this time.
0 commit comments