Added english blogroll

This commit is contained in:
Sjur Hernes committed 2012-07-04 20:17:29 +02:00
1 parent 671c95f983
commit 46cb579ae4
4 files changed
+156 -3

No files matched your search

+70
View File
@@ -0,0 +1,70 @@
<?php
/*
Plugin Name: english blog
Plugin URI: http://www.dagen.ifi.uio.no
Description: To hhave an english alternative blog
Version 0.1
Author: Sjur Hernes
Author URI: grey.sjux.net
License: GPL v2 or later
*/
?>
<?php
if (!class_exists("StudioEnglish")) {
class StudioEnglish {
function StudioEnglish(){
function studio_blog_english_type() {
register_post_type(
'englishblog',
array(
'labels' => array(
'name' => __( 'English' ),
'singular_name' => __( 'English' ),
'add_new' => __( 'Legg til ny post' ),
'add_new_item' => __( 'Legg til ny post' ),
'edit_item' => __( 'Rediger post' ),
'new_item' => __( 'Legg til ny post' ),
'view_item' => __( 'Vis post' ),
'search_items' => __( 'Søk etter post' ),
'not_found' => __( 'ingen posts funnet' ),
'not_found_in_trash' => __( 'ingen posts funnet i søppel' )
),
'menu_position' => 9,
'public' => true,
'publicly_queryable' => true,
'show-ui' => true,
'rewrite' => array(
'slug' => 'english',
'with_front' => false),
'query_var' => 'englishpost',
'capability_type' => 'post',
'map_meta_cap' => true,
'supports' => array(
'title',
'editor',
'author',
'thumbnail',
'administrator'
),
)
);
}
}
}
}
if (class_exists("StudioEnglish")) {
$studio_english_object = new StudioEnglish();
}
if ( isset($studio_english_object)){
add_action( 'init', 'studio_blog_english_type', 0);
add_action( 'save_post', 'studio_blog_english_save');
}
?>
+80
View File
@@ -0,0 +1,80 @@
/*
Template Name: english
*/
<?php get_header(); ?>
<?php get_sidebar(); ?>
<?php get_sidebar("right"); ?>
<?php
$type = 'englishblog';
$args=array(
'post_type' => $type,
'post_status' => 'publish',
'paged' => $paged,
'ignore_sticky_posts'=> 1
);
$temp = $wp_query; // assign orginal query to temp variable for later use
$wp_query = null;
$wp_query = new WP_Query($args);
?>
<div id="main-content">
<?php if (have_posts()) :
$post = $posts[0]; $c=0;
while (have_posts()) : the_post();
$c++; ?>
<?php if($c == 1) : ?>
<article <?php post_class("firstpostindex") ?> id="post-<?php the_ID(); ?>">
<div style="height: 350px;">
<?php the_post_thumbnail('firstpost'); ?>
<div class="social">
<a href="<?php the_permalink() ?>">
<img class="lesmer" src="<?php echo get_template_directory_uri(); ?>/images/knapp_opp_lesmer.png" alt="Les Mer" onmouseover=" this.src='<?php echo get_template_directory_uri(); ?>/images/knapp_ned_lesmer.png'" onmouseout=" this.src='<?php echo get_template_directory_uri(); ?>/images/knapp_opp_lesmer.png'" /></a>
<div class="fb-like lesmer" data-href="<?php the_permalink() ?>" data-send="false" data-layout="button_count" data-width="40" data-show-faces="false"></div>
<a href="https://twitter.com/share" class="twitter-share-button lesmer" data-url="<?php the_permalink() ?>" data-count="none" data-hashtags="STUDiO2012">Tweet</a>
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="//platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script>
</div>
<div class="entry">
<h2><a href="<?php the_permalink() ?>"><?php the_title(); ?></a></h2>
<?php the_excerpt(); ?>
</div>
</div>
<hr style="margin-top: 3em;" />
</article>
<?php else : ?>
<article <?php post_class("regular") ?> id="post-<?php the_ID(); ?>">
<div style="height: 210px;">
<div class="social">
<a href="<?php the_permalink() ?>">
<img class="lesmer" src="<?php echo get_template_directory_uri(); ?>/images/knapp_opp_lesmer.png" alt="Les Mer" onmouseover=" this.src='<?php echo get_template_directory_uri(); ?>/images/knapp_ned_lesmer.png'" onmouseout=" this.src='<?php echo get_template_directory_uri(); ?>/images/knapp_opp_lesmer.png'" /></a>
<div class="fb-like lesmer" data-href="<?php the_permalink() ?>" data-send="false" data-layout="button_count" data-width="40" data-show-faces="false"></div>
<a href="https://twitter.com/share" class="twitter-share-button lesmer" data-url="<?php the_permalink() ?>" data-count="none" data-hashtags="STUDiO2012">Tweet</a>
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="//platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script>
</div>
<?php the_post_thumbnail('restpost'); ?>
<div class="entry">
<h2><a href="<?php the_permalink() ?>"><?php the_title(); ?></a></h2>
<?php the_excerpt(); ?>
</div>
</div>
<hr />
</article>
<?php endif; ?>
<?php endwhile; ?>
<?php else : ?>
<h2>Not Found</h2>
<?php endif; ?>
</div>
<?php get_footer(); ?>
@@ -1,4 +1,7 @@
<div id="sidebar-right" class="sidebar">
<div class="countdown">
<h2><a href="<?php echo get_permalink(get_page_by_title('English')->ID); ?>">English</a></h2>
</div>
<?php if (function_exists('dynamic_sidebar') && dynamic_sidebar('Sidebar Widgets2')) : else : ?>
+3 -3
View File
@@ -152,7 +152,7 @@ hr { width: 60%; }
}
.countdown {
padding-bottom: 8px;
padding-bottom: 10px;
width: 100%;
background-color: rgb(14, 174, 91);
}
@@ -238,12 +238,12 @@ hr { width: 60%; }
font-size: 0.9em;
}
.firstpostindex .entry {
.home .firstpostindex .entry {
margin-left: 1em;
width: 40em;
}
.entry {
.home .entry {
position: absolute;
margin-left: 14em;
width: 24em;