-
Notifications
You must be signed in to change notification settings - Fork 0
/
functions.php
51 lines (38 loc) · 1.06 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
<?php
/**
* This file is part of Odyssey Theme for WordPress.
*/
require dirname(__FILE__) . '/oembend_featured_image.php';
// include odysssey libs
require dirname(__FILE__) . '/library/Odyssey/Autoloader.php';
\Odyssey\Autoloader::register();
// launch odyssey engine
function the_core() {
static $core;
if (!isset($core)) {
$core = \Odyssey\Core::get_instance();
}
return $core;
}
the_core();
// meh, no idea what do with that
if (!isset($content_width)) {
$content_width = 900;
}
remove_filter('check_comment_flood', 'check_comment_flood_db');
//add_action( 'template_redirect', 'redirect' );
function redirect() {
$args = array(
'numberposts' => 1,
'post_status' => 'publish'
);
$last = wp_get_recent_posts($args);
$last_id = $last['0']['ID'];
if ( is_home() && ! is_paged() && ! is_archive() && ! is_tag() && !isset($_GET['ptype']) ) :
wp_redirect( get_permalink($last_id) , 301 );
exit;
endif;
}
// enable comments on non-single pages (basically, home)
$withcomments = 1;
?>