-
Notifications
You must be signed in to change notification settings - Fork 0
/
functions.php
39 lines (34 loc) · 864 Bytes
/
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
<?php
/**
* Curzon Wordy functions and definitions
*
* @link https://developer.wordpress.org/themes/basics/theme-functions/
*
*/
// Hide admin toolbar on front end
add_filter( 'show_admin_bar', '__return_false' );
// Register Navigation Menus
function register_navigation() {
register_nav_menus(
array(
'main' => 'Main Navigation',
'footer' => 'Footer Links'
)
);
}
add_action( 'init', 'register_navigation' );
// Display Copyright notice
function create_copyright() {
$all_posts = get_posts( 'post_status=publish&order=ASC' );
$first_post = $all_posts[0];
$first_date = $first_post->post_date_gmt;
_e( 'Copyright © ' );
if ( substr( $first_date, 0, 4 ) == date( 'Y' ) ) {
echo date( 'Y' );
} else {
echo substr( $first_date, 0, 4 ) . "-" . date( 'Y' );
}
echo get_bloginfo( 'name' );
_e( 'All rights reserved.' );
}
?>