Selaa lähdekoodia

Wrap in a class if displayed on mobile

torres126 6 vuotta sitten
vanhempi
commit
bcdd6e8b12
1 muutettua tiedostoa jossa 12 lisäystä ja 2 poistoa
  1. 12 2
      apostrophe-2/inc/jetpack.php

+ 12 - 2
apostrophe-2/inc/jetpack.php

@@ -61,13 +61,23 @@ function apostrophe_2_has_post_thumbnail( $post = null ) {
 }
 }
 
 
 /**
 /**
- * Return early if Social Menu is not available.
+ * Return early if Social Menu is not available and check if it should be displayed on mobile.
  */
  */
 function apostrophe_2_social_menu() {
 function apostrophe_2_social_menu() {
 	if ( ! function_exists( 'jetpack_social_menu' ) ) {
 	if ( ! function_exists( 'jetpack_social_menu' ) ) {
 		return;
 		return;
-	} else {
+	} 
+	
+	if ( function_exists( 'jetpack_social_menu' ) && ( get_theme_mod( 'apostrophe_2_mobile_social' ) == 0 )) {
 		jetpack_social_menu();
 		jetpack_social_menu();
+	} 
+	
+	if ( function_exists( 'jetpack_social_menu' ) && ( get_theme_mod( 'apostrophe_2_mobile_social' ) == 1 ) ) {
+	?>
+		<div class="social-mobile-menu">
+			<?php jetpack_social_menu(); ?>
+		</div>
+	<?php
 	}
 	}
 }
 }