Archived
Footer text now customizeable
This commit is contained in:
1 parent
654882dadb
commit
a23e5c65b7
2 files changed
+38
-3
No files matched your search
@@ -1,12 +1,11 @@
|
||||
|
||||
<?php $footer_about_text = get_theme_mod( 'footer_about_text',""); ?>
|
||||
<footer id="site-footer">
|
||||
<div id="footer-container">
|
||||
<div id="footer-about">
|
||||
<h2><a href="om-oss/" class="black">Teater Neuf</a></h2>
|
||||
<!-- TODO: Move to Theme -> Customize -->
|
||||
<a href="https://viteboka.studentersamfundet.no/Den_Hvide_Knap"><img class="knapp-hvit" src="<?php bloginfo( 'stylesheet_directory' ); ?>/img/knapp_hvit.png" /></a>
|
||||
<p>Teater Neuf - Studentteatret i Oslo er <em>Norges eldste studentteater</em>, tilbyr studenter både kunstnerisk utvikling og lavterskelmoro ved siden av pensum.
|
||||
Vi holder til på Det Norske Studentersamfund og har i tillegg til fire forestillinger per semester og én storproduksjon i året, også ukentlige aktiviteter, workshops, interne fester og mer.</p>
|
||||
<p><?php echo $footer_about_text; ?></p>
|
||||
<ul>
|
||||
<li class="social-icon"><a id="facebook-icon" href="http://facebook.com/teaterneuf" target="_blank"><img src="<?php bloginfo( 'stylesheet_directory' ); ?>/img/facebook.png" />Besøk oss på Facebook</a></li>
|
||||
<li class="social-icon"><a id="twitter-icon" href="http://twitter.com/teater_neuf" target="_blank"><img src="<?php bloginfo( 'stylesheet_directory' ); ?>/img/twitter.png" />eller følg oss Twitter</a>.</li>
|
||||
|
||||
@@ -370,4 +370,40 @@ function neuf_get_term_name() {
|
||||
return $term->name;
|
||||
}
|
||||
|
||||
/* Customize theme options
|
||||
* Ref: http://ottopress.com/2012/making-a-custom-control-for-the-theme-customizer/
|
||||
*/
|
||||
if (class_exists('WP_Customize_Control')) {
|
||||
class Customize_Textarea_Control extends WP_Customize_Control {
|
||||
public $type = 'textarea';
|
||||
|
||||
public function render_content() {
|
||||
?>
|
||||
<label>
|
||||
<span class="customize-control-title"><?php echo esc_html( $this->label ); ?></span>
|
||||
<textarea rows="5" style="width:100%;" <?php $this->link(); ?>><?php echo esc_textarea( $this->value() ); ?></textarea>
|
||||
</label>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function neuf_customize_register( $wp_customize ) {
|
||||
/* Footer text */
|
||||
$wp_customize->add_section( 'neuf_footer_section' , array(
|
||||
'title' => __( 'Footer (about)', 'neuf-web' ),
|
||||
'priority' => 30,
|
||||
) );
|
||||
$wp_customize->add_setting( 'footer_about_text' , array(
|
||||
'default' => '',
|
||||
) );
|
||||
$wp_customize->add_control(
|
||||
new Customize_Textarea_Control( $wp_customize, 'footer_about_text', array(
|
||||
'label' => __( 'About text', 'neuf-web' ),
|
||||
'section' => 'neuf_footer_section',
|
||||
'settings' => 'footer_about_text',
|
||||
) )
|
||||
);
|
||||
}
|
||||
add_action( 'customize_register', 'neuf_customize_register' );
|
||||
?>
|
||||
Reference in new issue
Block a user