-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtemplate-music.php
41 lines (29 loc) · 1023 Bytes
/
template-music.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
<?php
/*
Template Name: Music Page
*/
?>
<?php get_header(); ?>
<div id="page_content" class="page_section music_section">
<div class="wrap">
<?php
//get music records based on template selection
$albums = get_field('music_page_music');
//loop through each album
foreach( $albums as $album ){
$ID = $album->ID; //get_field returns the IDs of the music entry, but not the actual music entry, so we need to grab the ID...
$fields = get_fields($ID); //...and get the fields associated with it.
//set variables based on fields
$music_iframe = $fields['soundcloud_iframe_code'];
$feature_type = $fields['feature_type'];
$album_title = $fields['feature_title'];
$album_desc = $fields['feature_description'];
$button_text = $fields['button_text'];
$button_url = $fields['button_url'];
//include the music snippet to populate the varialbes into
include( 'snippets/section-music.php' );
}
?>
</div>
</div>
<?php get_footer(); ?>