-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfunctions.php
More file actions
91 lines (78 loc) · 2.34 KB
/
functions.php
File metadata and controls
91 lines (78 loc) · 2.34 KB
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
<?php
/*
* npoat Functions
*
* @package wordpress
* @subpackage npoat
* @version 1.0.1
*
*/
// Set the content width, for videos and photos for defaults
if ( ! isset( $content_width ) )
$content_width = 500;
/**
* Class npoat
*/
Class npoat{
/*
* Constructor
*/
function __construct() {
// Load npoat text domain
load_theme_textdomain('npoat', TEMPLATEPATH. '/languages');
// Theme supports
add_theme_support( 'post-thumbnails' );
add_theme_support( 'automatic-feed-links' );
// Editor style for TinyMCE.
add_editor_style();
// Register image sizes
add_image_size( 'home-page-slider', 440, 250, true );
// Add shortcodes
add_shortcode( 'column', array( &$this, 'npoat_column' ) );
// Register our primary navigation (top left) ans 404 page links
if ( function_exists( 'register_nav_menu' ) ) {
add_theme_support( 'nav_menus' );
register_nav_menu( 'primary', __( 'Primary Navigation Menu', 'npoat') );
}
/*
* Registers sidebars for widgets
*/
add_action( 'widgets_init', array( &$this, 'register_sidebars' ) );
}
/*
* Register Sidebars
*
* Registers a single right sidebar ready for widgets.
*
*/
function register_sidebars() {
register_sidebar( array(
'name' => __( 'Home page Sidebar', 'sipahiler' ),
'id' => 'sidebar-home',
'description' => __( 'The sidebar for the Home Template', 'sipahiler' ),
'before_widget' => '<div class="widget">',
'after_widget' => '</div></div>',
'before_title' => '<div class="widget-title">',
'after_title' => '</div><div class="widget-text">',
) );
}
function npoat_column( $atts, $content ) {
extract( shortcode_atts( array(
'position' => '',
'title' => ''
), $atts ) );
if ( $position == 'left' ) {
$content = wpautop( $content );
$output = "<h2 class='single-page-title'>" . $title . "</h2>";
$output .= "<div class='grid_7 alpha'><div class='left-column'>";
$output .= $content;
$output .= "</div></div>";
}
elseif ( $position == 'right' ) {
$output = "<div class='grid_5 omega'><div class='right-column'>{$content}</div></div>";
}
return $output;
}
}
// Initialize the above class after theme setup
add_action( 'after_setup_theme', create_function( '', 'global $npoat; $npoat = new npoat();' ) );