summaryrefslogtreecommitdiff
path: root/functions.php
blob: fa789ec9538c152e63d234e8df487a86448f99c1 (plain)
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
<?php
/**
 * remulus functions and definitions
 *
 * @package remulus
 */

function remulus_setup() {
  register_nav_menus(array(
    'primary' => __('Primary Menu', 'remulus'),
    'secondary' => __('Footer Menu', 'remulus'),
  ));

  add_image_size('remulus-blog', 660, 495);
  add_image_size('remulus-movie', 852, 639, true);
  add_image_size('remulus-movie-small', 420, 315, true);
  update_option('image_default_size', 'remulus-blog');
  update_option('image_default_link_type','none');
}
add_action( 'after_setup_theme', 'remulus_setup' );


function remulus_filter_image_sizes( $sizes ) {
  unset($sizes['thumbnail']);
  unset($sizes['medium']);
  unset($sizes['large']);

  return $sizes;
}
add_filter('intermediate_image_sizes_advanced', 'remulus_filter_image_sizes');


function remulus_custom_image_sizes($sizes) {
  unset($sizes['medium']);
  unset($sizes['large']);

  $custom_sizes = array(
    'remulus-blog' => 'Blog',
  );

  return array_merge($sizes, $custom_sizes);
}
add_filter('image_size_names_choose', 'remulus_custom_image_sizes');


function remulus_scripts() {
  wp_enqueue_style('remulus-style', get_stylesheet_uri());
  wp_enqueue_style('remulus-font-awesome', '//netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.min.css', array(), '4.0.3');
  wp_enqueue_style('remulus-open-sans', '//fonts.googleapis.com/css?family=Open+Sans:300,300italic,400,400italic,600,600italic');
}
add_action( 'wp_enqueue_scripts', 'remulus_scripts' );


function remulus_add_ie_html5_shim () {
  echo "<!--[if lt IE 9]>\n";
  echo '<script src="', get_template_directory_uri() .'/js/html5shiv.js"></script>'."\n";
  echo "<![endif]-->\n";
}
add_action('wp_head', 'remulus_add_ie_html5_shim');


if ( ! function_exists( 'remulus_paging_nav' ) ) :
function remulus_paging_nav() {
  // Don't print empty markup if there's only one page.
  if ( $GLOBALS['wp_query']->max_num_pages < 2 ) {
    return;
  }
  ?>
  <article>
    <nav class="navigation paging-navigation" role="navigation">
      <div class="nav-links">
        <?php if ( get_next_posts_link() ) : ?>
        <div class="nav-previous"><?php next_posts_link( __( 'Older posts', 'remulus' ) ); ?></div>
        <?php endif; ?>

        <?php if ( get_previous_posts_link() ) : ?>
        <div class="nav-next"><?php previous_posts_link( __( 'Newer posts', 'remulus' ) ); ?></div>
        <?php endif; ?>
      </div>
    </nav>
  <article>
  <?php
}
endif;


function remulus_modify_contact_methods($profile_fields) {
  $profile_fields['twitter'] = 'Twitter URL';
  $profile_fields['facebook'] = 'Facebook URL';
  $profile_fields['linkedin'] = 'linkedin URL';
  $profile_fields['xing'] = 'xing URL';

  return $profile_fields;
}
add_filter('user_contactmethods', 'remulus_modify_contact_methods');

/**
* Custom template tags for this theme.
*/
require get_template_directory() . '/inc/movie.php';