Skip to content

Instantly share code, notes, and snippets.

View jerrickhakim's full-sized avatar

Jerrick Hakim jerrickhakim

View GitHub Profile
@jerrickhakim
jerrickhakim / CSS
Last active March 17, 2020 13:03
Flatsome Fancy Icon Nav
/* SIDE NAV CSS DESKTOP */
.mfp-content {
width: 30% !important;
/* OPTION TO MAKE NAV TRANSPARENT */
/* DELETE OR TURN TO 1 IF YOU DONT WANT THE MENU TO BE TRANSPARENT */
opacity: 0.95 !important;
}
li.html.custom.html_nav_position_text {
padding: 0px;
}
jQuery(document).ready(function($) {
var referrer = document.referrer;
if (referrer == 'urlhere/') {
$("#ID").css("display", "block");
}
});
(function($){
$(document).ready(function(){
$("#VIDID").bind('ended', function(){
location.href="/urlhere";
});
});
}(jQuery));
<video id="vid" width="100%" controls poster="/posterurlhere" playsinline autoplay muted><source src="/videourl.mp4" type="video/mp4">Your browser does not support HTML5 video.</video><script type="text/javascript">
video = document.getElementById('vid');
video.addEventListener('ended',function() {alert('video is ended');window.location.href = '/redirecturl';})
</script>
@jerrickhakim
jerrickhakim / CSS to remove username and password again field
Last active February 14, 2018 06:20
Restrict Content Pro - Remove Required Info on Registration Form - Username=Email & Remove Password Again
/* RCP REGISTER FORM STYLING */
/* CSS TO REMOVE USERNAME AND PASSWORD AGAIN */
p#rcp_user_login_wrap, p#rcp_password_again_wrap {
display: none;
}
/* END CSS TO REMOVE USERNAME AND PASSWORD AGAIN */
@jerrickhakim
jerrickhakim / WordPress Redirect After Logout
Created January 30, 2018 07:18
Paste this code in the functions.php file in your child theme to choose where you would like your visitor to be redirected after they logout.
/* WORDPRESS REDIRECT ON LOGOUT */
add_action('wp_logout','auto_redirect_after_logout');
function auto_redirect_after_logout(){
wp_redirect( home_url("/login") );
exit();
}
/* END WORDPRESS REDIRECT ON LOGOUT */
[section class="menu" bg="1612" bg_color="rgb(0, 0, 0)" bg_pos="54% 43%" padding="0px" height="100vh" margin="0px"]
[row style="collapse" width="full-width" v_align="middle" h_align="center"]
[col span__sm="12" align="center" color="light"]
[gap]
<h1 class="uppercase" style="text-align: center;"><span class="fancy-underline">Site Nav</span></h1>
[gap height="20px"]
<style>
/* EMAIL FORM STYLING */
#subscribe-form-email-light {
border: none; /* BORDER OF EMAIL FORM*/
box-shadow: none;
border-bottom: solid 1px black;
padding-right: 4px;
font-family: oswald, FontAwesome;
color: black !important;
background: transparent !important;
@jerrickhakim
jerrickhakim / WordPress Redirect Based On User Role & Page ID
Last active January 30, 2018 07:25
WordPress Redirect Based On User Role & Page ID. This code is great for Restrict Content Pro. I use it to redirect the sign up pages to the members area. That is if they have purchased the specific level and each level is assigned a custom user role with the same access as a subscriber. However, this code can be used for a variety of application…
/* CUSTOM REDIRECT PER USER ROLE AND PAGE ID */
add_action('template_redirect', 'redirect_user_role');
function redirect_user_role($priority = 1)
{
if(current_user_can('Administrator') && is_page('1988'))
{
wp_redirect('/urlhere');
}
if ( is_user_logged_in() && is_page('1883'))
{
@jerrickhakim
jerrickhakim / Load FontAwesome in functions.php file | WordPress
Last active January 25, 2018 06:27
Load FontAwesome in functions.php file | WordPress
//LOAD FONT AWESOME
add_action( 'wp_enqueue_scripts', 'enqueue_load_fa' );
function enqueue_load_fa() {
wp_enqueue_style( 'load-fa', 'https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css' );
}
// END LOAD FONT AWESOME