-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfunctions.php
27 lines (23 loc) · 931 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
<?php
// Check if we are on mobile
function jetpackme_is_mobile() {
// Are Jetpack Mobile functions available?
if ( ! function_exists( 'jetpack_is_mobile' ) )
return false;
// Is Mobile theme showing?
if ( isset( $_COOKIE['akm_mobile'] ) && $_COOKIE['akm_mobile'] == 'false' )
return false;
return jetpack_is_mobile();
}
add_action( 'wp_enqueue_scripts', 'theme_enqueue_styles' );
function theme_enqueue_styles() {
wp_enqueue_style( 'parent-style', get_template_directory_uri() . '/style.css' );
wp_enqueue_style( 'child-style', get_stylesheet_uri(), array( 'parent-style' ) );
if ( jetpackme_is_mobile() ) {
wp_enqueue_style( 'mobile-style', get_stylesheet_directory_uri() . '/mobile.css' );
}
}
function code_shortcode( $atts, $content = null ) {
return '<span class="code">' . $content . '</span>';
}
add_shortcode( 'code', 'code_shortcode' );