Created
March 1, 2017 13:42
-
-
Save pranali333/0f5aa249a7f9250cba7eb640af6abaf8 to your computer and use it in GitHub Desktop.
Custom code to keep rtMedia default sorting option in the same line with other rtMedia sort parameters under shortcode
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* This snippet is used to align rtMedia default sorting option with other rtMedia sort parameters | |
* under rtMedia shortcode. | |
* You can try using this code under your theme's functions.php file. | |
*/ | |
if ( ! function_exists( 'rtmedia_wp_head_fix_sorting_button' ) ) { | |
function rtmedia_wp_head_fix_sorting_button() { | |
// Check if the constant RTMEDIA_SORTING_VERSION exists. | |
if ( defined( 'RTMEDIA_SORTING_VERSION' ) ) { | |
// check if the RTMEDIA_SORTING_VERSION constant version is less then 1.1.6. | |
if ( version_compare( RTMEDIA_SORTING_VERSION, '1.1.6', '<=' ) ) { | |
?> | |
<style type="text/css"> | |
.rtmedia-container .rtmedia-sortable-parameters { | |
width: auto; | |
display: inline-block; | |
} | |
.rtp-main-wrapper #rtm-gallery-title-container #rtm-media-options { | |
padding-top: 0; | |
} | |
</style> | |
<?php | |
} else { | |
?> | |
<style type="text/css"> | |
#rtm-gallery-title-container { | |
position: relative; | |
} | |
.rtp-html #rtm-gallery-title-container .rtm-gallery-title { | |
display: inline-block; | |
} | |
.rtp-main-wrapper #rtm-gallery-title-container #rtm-media-options { | |
margin-bottom: 0; | |
position: absolute; | |
right: 0; | |
padding-top: 0; | |
top: 100%; | |
} | |
</style> | |
<?php | |
} | |
} | |
} | |
} | |
add_action( 'wp_head', 'rtmedia_wp_head_fix_sorting_button' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment