Archived
artister
This commit is contained in:
1 parent
25973d8e54
commit
fe5441af2d
3 files changed
+40
-22
No files matched your search
@@ -82,6 +82,7 @@ Create the fields the post type should have
|
||||
global $post;
|
||||
|
||||
$artist_font = get_post_meta($post->ID, 'studio_artist_font' , true);
|
||||
$artist_color = get_post_meta($post->ID, 'studio_artist_color' , true);
|
||||
$artist_link = get_post_meta($post->ID, 'studio_artist_link', true);
|
||||
$artist_event = get_post_meta($post->ID, 'studio_artist_event', true);
|
||||
|
||||
@@ -89,12 +90,12 @@ Create the fields the post type should have
|
||||
echo '<select name="studio_artist_font">';
|
||||
echo $artist_font;
|
||||
|
||||
$types = array( array('name' => 'Flink i Guitarhero' , 'size' => 'minst'),
|
||||
array('name' => 'Liten Artist' , 'size' => 'liten'),
|
||||
array('name' => 'Mellomstor Artist' , 'size' => 'normalliten'),
|
||||
array('name' => 'Stor Artist' , 'size' => 'normalstor'),
|
||||
array('name' => 'Oh! Dette blir fest!' , 'size' => 'stor'),
|
||||
array('name' => 'Hopalong Knut!!' , 'size' => 'mega'),
|
||||
$types = array( array('name' => 'Flink i Guitarhero' , 'size' => 'str1'),
|
||||
array('name' => 'Liten Artist' , 'size' => 'str2'),
|
||||
array('name' => 'Mellomstor Artist' , 'size' => 'str3'),
|
||||
array('name' => 'Stor Artist' , 'size' => 'str4'),
|
||||
array('name' => 'Oh! Dette blir fest!' , 'size' => 'str5'),
|
||||
array('name' => 'Hopalong Knut!!' , 'size' => 'str6'),
|
||||
);
|
||||
|
||||
foreach($types as $type){
|
||||
@@ -105,6 +106,26 @@ Create the fields the post type should have
|
||||
}
|
||||
echo '</select><br />';
|
||||
|
||||
echo "artistfarge:";
|
||||
echo '<select name="studio_artist_color">';
|
||||
echo $artist_color;
|
||||
|
||||
$types = array( array('name' => 'Red' , 'clr' => 'redart'),
|
||||
array('name' => 'Blue' , 'clr' => 'blueart'),
|
||||
array('name' => 'Purple' , 'clr' => 'purpleart'),
|
||||
array('name' => 'Green' , 'clr' => 'greenart'),
|
||||
);
|
||||
|
||||
foreach($types as $type){
|
||||
echo '<option value="' . $type['clr'] . '"';
|
||||
if($type['clr'] == $artist_color)
|
||||
echo ' selected="selected"';
|
||||
echo '>' . $type['name'] . '</option>';
|
||||
}
|
||||
echo '</select><br />';
|
||||
|
||||
|
||||
|
||||
echo 'Event:
|
||||
<select name="studio_artist_event">';
|
||||
echo $artist_event;
|
||||
@@ -141,6 +162,7 @@ echo '<br />Artisturl:<br /><input type="text" name="studio_artist_link" value="
|
||||
|
||||
// Get posted data
|
||||
$studart['studio_artist_font'] = $_POST['studio_artist_font' ];
|
||||
$studart['studio_artist_color'] = $_POST['studio_artist_color' ];
|
||||
$studart['studio_artist_link'] = $_POST['studio_artist_link'];
|
||||
$studart['studio_artist_event'] = $_POST['studio_artist_event'];
|
||||
|
||||
|
||||
@@ -72,7 +72,7 @@ class Artist_Widget extends WP_Widget {
|
||||
function widget($args, $instance) {
|
||||
global $post, $wp_locale;
|
||||
$args['title'] = '';
|
||||
$studart = new WP_Query( array('post_type' => 'artist', 'posts_per_page' => -1, 'orderby' => 'rand'));
|
||||
$studart = new WP_Query( array('post_type' => 'artist', 'posts_per_page' => -1, 'orderby' => 'meta_value', 'meta_key' => 'studio_artist_font'));
|
||||
echo $args['before_widget'] . $args['before_title'] . $args['title'] . $args['after_title'];
|
||||
if ( $studart->have_posts() ) {
|
||||
while ( $studart->have_posts() ) {
|
||||
@@ -81,7 +81,7 @@ class Artist_Widget extends WP_Widget {
|
||||
// event-lenka
|
||||
$event = get_post_meta($post->ID, 'studio_artist_event', true);
|
||||
// ekstern lenke for artisten
|
||||
echo '<p class="artist '.get_post_meta($post->ID, 'studio_artist_font', true).' '.get_post_meta($event, 'neuf_events_type', true)."\"><a href=\"" . get_post($event)->guid . "\">" . get_the_title() . '</a></p>';
|
||||
echo '<p class="artist '.get_post_meta($post->ID, 'studio_artist_font', true).' '.get_post_meta($post->ID, 'studio_artist_color', true)."\"><a href=\"" . get_post($event)->guid . "\">" . get_the_title() . '</a></p>';
|
||||
|
||||
}
|
||||
} echo "<hr />";
|
||||
|
||||
@@ -175,20 +175,16 @@ hr { width: 60%; }
|
||||
.widget .artist :hover {
|
||||
text-decoration: underline;
|
||||
}
|
||||
.widget .liten a { font-size: 18px;}
|
||||
.widget .normalliten a { font-size: 21px; }
|
||||
.widget .normalstor a { font-size: 24px; }
|
||||
.widget .stor a { font-size: 27px; }
|
||||
.widget .mega a { font-size: 30px; }
|
||||
.widget .Konsert a { color: blue; }
|
||||
.widget .Annet a { color: red; }
|
||||
.widget .Foredrag a { color: yellow; }
|
||||
.widget .Klub a { color: green; }
|
||||
.widget .Quiz a { color: purple; }
|
||||
.widget .Stand-up a { color: pink; }
|
||||
.widget .Konkurranse a { color: cyan; }
|
||||
.widget .Lyntale a { color: magenta; }
|
||||
|
||||
.widget .str1 a { font-size: 18px;}
|
||||
.widget .str2 a { font-size: 22px; }
|
||||
.widget .str3 a { font-size: 26px; }
|
||||
.widget .str4 a { font-size: 30px; }
|
||||
.widget .str5 a { font-size: 34px; }
|
||||
.widget .str6 a { font-size: 38px; }
|
||||
.widget .blueart a { color: rgb(46, 168, 224); }
|
||||
.widget .redart a { color: rgb(236, 59, 38) ; }
|
||||
.widget .greenart a { color: rgb(6, 164, 76) ; }
|
||||
.widget .purpleart a { color: rgb(101, 45, 144); }
|
||||
|
||||
.post, .event {
|
||||
padding: 1em 2em 0 2em;
|
||||
|
||||
Reference in new issue
Block a user