From c859ea416d55199f56431922ec5d8fa4bc19008e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=98yvind=20Bakkeli?= Date: Tue, 5 Jul 2011 12:28:08 +0200 Subject: [PATCH] =?UTF-8?q?La=20til=20egen=20template=20for=20single=20eve?= =?UTF-8?q?nter,=20artister=20og=20mulighet=20for=20=C3=A5=20hente=20ut=20?= =?UTF-8?q?relasjoner=20i=20functions.php?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- functions.php | 32 ++++++++++++++++- single-artist.php | 89 +++++++++++++++++++++++++++++++++++++++++++++++ single-event.php | 88 ++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 208 insertions(+), 1 deletion(-) create mode 100644 single-artist.php create mode 100644 single-event.php diff --git a/functions.php b/functions.php index e0cdd31..5c56925 100644 --- a/functions.php +++ b/functions.php @@ -61,4 +61,34 @@ class Artist_Widget extends WP_Widget { } register_widget('Program_Widget'); -register_widget('Artist_Widget'); \ No newline at end of file +register_widget('Artist_Widget'); + +function get_related_artists( $post_id) +{ + $related = get_posts( array( + 'connected_from' => $post_id, + 'nopaging' => true, + 'post_type' => 'artist', + 'suppress_filters' => false + )); + + if ( empty( $related )) + return array(); + + return $related; +} + +function get_related_events( $post_id) +{ + $related = get_posts( array( + 'connected_to' => $post_id, + 'nopaging' => true, + 'post_type' => 'event', + 'suppress_filters' => false + )); + + if ( empty( $related )) + return array(); + + return $related; +} diff --git a/single-artist.php b/single-artist.php new file mode 100644 index 0000000..ae73d49 --- /dev/null +++ b/single-artist.php @@ -0,0 +1,89 @@ + + +
+
+ + + +
> +

+ + + +
+ + '' ) ); ?> +
+ + +
+
+ +
+ +
+ +ID); + ?> + + +
+ + ', '' ); ?> +
+
+ + + + + +
+
+ + + diff --git a/single-event.php b/single-event.php new file mode 100644 index 0000000..a14d1dd --- /dev/null +++ b/single-event.php @@ -0,0 +1,88 @@ + + +
+
+ + + +
> +

+ + + +
+ + '' ) ); ?> +
+ + +
+
+ +
+ +
+ +ID); + +?> + + +
+ + ', '' ); ?> +
+
+ + + + + +
+
+ + +