Created
December 2, 2024 07:44
-
-
Save andrewlimaza/676ceff1fcd8d1b492cf89a8419f1ec7 to your computer and use it in GitHub Desktop.
Move the content restricted message higher up the course content for LifterLMS
This file contains 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
<?php | |
/** | |
* Move the Paid Memberships Pro content restricted message higher up in LifterLMS course content. | |
* This requires "Course Information" block to be on the page and shown before this using jQuery. | |
* Tweak this jQuery code to fit your needs and move the content higher up. | |
* | |
* To add the code to your site you may follow this guide - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
*/ | |
function my_move_pmpro_div_with_jquery_llms() { | |
?> | |
<script type="text/javascript"> | |
jQuery(document).ready(function ($) { | |
if ($('article').hasClass('course')) { | |
if ($('.entry-title').length && $('.pmpro').length) { | |
$('.pmpro').insertBefore('.llms-meta-info'); | |
} | |
} | |
}); | |
</script> | |
<?php | |
} | |
add_action('wp_footer', 'my_move_pmpro_div_with_jquery_llms'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment