-
Notifications
You must be signed in to change notification settings - Fork 0
/
functions.php
107 lines (90 loc) · 2.54 KB
/
functions.php
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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
<?php
function pp_get_footer_widgets()
{
pp_get_side_bar('footer_widget_1');
pp_get_side_bar('footer_widget_2');
pp_get_side_bar('footer_widget_3');
pp_get_side_bar('footer_widget_4');
}
function pp_get_side_bar($id)
{
if ( function_exists('dynamic_sidebar') )
dynamic_sidebar($id);
}
function pp_widgets_init()
{
if ( function_exists('register_sidebar') )
{
register_sidebar( array(
'name' => 'Primary Sidebar',
'id' => 'primary_side_bar',
'before_widget' => '<div>',
'after_widget' => '</div>',
'before_title' => '<h2 class="rounded">',
'after_title' => '</h2>',
) );
register_sidebar( array(
'name' => 'Footer Widget 1',
'id' => 'footer_widget_1',
'before_widget' => '<div>',
'after_widget' => '</div>',
'before_title' => '<h2 class="rounded">',
'after_title' => '</h2>',
) );
register_sidebar( array(
'name' => 'Footer Widget 2',
'id' => 'footer_widget_2',
'before_widget' => '<div>',
'after_widget' => '</div>',
'before_title' => '<h2 class="rounded">',
'after_title' => '</h2>',
) );
register_sidebar( array(
'name' => 'Footer Widget 3',
'id' => 'footer_widget_3',
'before_widget' => '<div>',
'after_widget' => '</div>',
'before_title' => '<h2 class="rounded">',
'after_title' => '</h2>',
) );
register_sidebar( array(
'name' => 'Footer Widget 4',
'id' => 'footer_widget_4',
'before_widget' => '<div>',
'after_widget' => '</div>',
'before_title' => '<h2 class="rounded">',
'after_title' => '</h2>',
) );
}
}
function pp_theme_image($path)
{
$path = get_theme_root_uri() . "/purple/images/" . $path;
echo "<img src='$path' alt='path'/>";
}
function pp_get_menu()
{
wp_list_pages('title_li=');
}
function pp_get_search_form()
{
echo 'Search <input type="text" class="search-box"/>';
}
function pp_get_feauture_page($id)
{
//file_get_contents("feature_$id.html");
//$filepath = dirname(__FILE__) . DIRECTORY_SEPARATOR ."feature_$id.html";
//$filepath = __DIR__ . DIRECTORY_SEPARATOR . "/wp-content/themes/purple/feature_$id.html";
$filepath = $_SERVER['DOCUMENT_ROOT'] . '/wp-content/themes/purple/' ."feature_$id.html";
$filepath = str_replace("\\","/",$filepath);
if(file_exists($filepath)==1)
{
echo '<div class="feature-content content-curve-all drop-shadow"><div class="wrapper">' . file_get_contents($filepath) . '</div></div>';
}
else
{
echo "File does not exist: $filepath";
}
}
/** Register sidebars by running twentyten_widgets_init() on the widgets_init hook. */
add_action( 'widgets_init', 'pp_widgets_init' );