-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfunctions.php
77 lines (55 loc) · 1.91 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
<?php
// CONSTANTS
define( 'WP_SITE_URL', get_bloginfo('url') );
define( 'WP_THEME_URL', get_bloginfo( 'stylesheet_directory' ) );
define( 'WP_TODAY', date('Y_m_d',strtotime('00:00:00')));
// POST THUMBNAILS
add_theme_support('post-thumbnails');
// add_theme_support('post-thumbnails', array('post', 'page'));
// set_post_thumbnail_size( 512, 512, false );
// add_image_size( '2x', 1024, 1024, false );
// add_image_size( '4x', 2048, 2048, false );
add_image_size( 'square-large', 512, 512, true );
add_image_size( 'square-medium', 256, 256, true );
add_image_size( 'square-small', 128, 128, true );
// INCLUDES
include 'inc/wrapping.php';
include 'inc/fb-opengraph.php';
include 'inc/post-types.php';
include 'inc/posts2posts.php';
include 'inc/webflow-walker.php';
//include 'inc/taxonomies.php';
// ADMIN MENU ORDER
function medialab_custom_menu_order() {
return array( 'index.php', 'separator1', 'edit.php?post_type=page' );
}
add_filter( 'custom_menu_order', '__return_true' );
add_filter( 'menu_order', 'medialab_custom_menu_order' );
// REGISTER MENU
function register_main_menu() {
register_nav_menu('main-menu',__( 'Menu Principal' ));
}
add_action( 'init', 'register_main_menu' );
// REMOVE ADMIN BAR
// add_filter('show_admin_bar', '__return_false');
// TITLE FILTER
function wp_title_filter( $title, $sep ) {
if ( is_feed() ) {
return $title;
}
global $page, $paged;
// Add the blog name
$title = get_bloginfo( 'name', 'display' ) . " " . $title;
// Add the blog description for the home/front page.
$site_description = get_bloginfo( 'description', 'display' );
if ( $site_description && ( is_home() || is_front_page() ) ) {
$title .= " $sep $site_description";
}
// Add a page number if necessary:
if ( ( $paged >= 2 || $page >= 2 ) && ! is_404() ) {
$title .= " $sep " . sprintf( __( 'Pag. %s', '_s' ), max( $paged, $page ) );
}
return $title;
}
add_filter( 'wp_title', 'wp_title_filter', 10, 2 );
?>