Skip to content

Instantly share code, notes, and snippets.

@SJ-James
Created March 7, 2018 10:42
Show Gist options
  • Save SJ-James/738f9187833b18d44ac9a822d0976163 to your computer and use it in GitHub Desktop.
Save SJ-James/738f9187833b18d44ac9a822d0976163 to your computer and use it in GitHub Desktop.
Divi Mod - Move Slide In Social Icons Into The Main Header
<?php
// Execute as function or preferably move CSS and jQuery into correct child theme files.
function sj_move_social_icons() { ?>
<script>
jQuery(function($){
// Use jQuery to move the object
$(".et_slide_menu_top .et-social-icons").insertBefore("#et-top-navigation");
});
</script>
<style>
/* Apply CSS only once the icons have been moved */
.et_header_style_slide #main-header .et-social-icons {
position: absolute;
right: 50px;
height: 100%;
display: flex;
-webkit-display: flex;
align-items: center;
-webkit-align-items: center;
}
.et_header_style_slide #main-header .et-social-icon a {
font-size: 16px;
}
</style>
<?php
}
add_action('wp_footer', 'sj_move_social_icons');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment