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
<form id="123" method="post" action="" form-id="123" class="-form" onsubmit="event.preventDefault();"> | |
<form-header class="-header"> | |
<h6>Chapter</h6> | |
<h3>Title</h3> | |
<p>What to expect in this form</p> | |
</form-header> | |
<form-fields class="-fields"> | |
<form-field class="-field -required" data-field="a7993147"> | |
<label class="-label"> | |
<span class="-title">Uw naam</span> |
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
function scan_dir($dir) { | |
$ignored = array('.', '..', '.svn', '.htaccess'); // -- ignore these file names | |
$files = array(); //----------------------------------- create an empty files array to play with | |
foreach (scandir($dir) as $file) { | |
if ($file[0] === '.') continue; //----------------- ignores all files starting with '.' | |
if (in_array($file, $ignored)) continue; //-------- ignores all files given in $ignored | |
$files[$file] = filemtime($dir . '/' . $file); //-- add to files list | |
} | |
arsort($files); //------------------------------------- sort file values (creation timestamps) | |
$files = array_keys($files); //------------------------ get all files after sorting |
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
// add this to your functions file | |
add_shortcode('shortcode_name_here', 'my_login_form_shortcode'); | |
function my_login_form_shortcode( $attr ) { | |
if ( is_user_logged_in() ) | |
return ''; | |
/* Set up some defaults. */ | |
$defaults = array( | |
'label_username' => 'Username', |
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
(function( $ ) { | |
var acfPlugin; | |
//http://stackoverflow.com/a/965962 | |
jQuery.expr[':'].parents = function(a,i,m){ | |
return jQuery(a).parents(m[3]).length < 1; | |
}; | |
var AcfPlugin = function() { |
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
var iScrollPos = 0; | |
$(window).scroll(function () { | |
var iCurScrollPos = $(this).scrollTop(); | |
if(iCurScrollPos<=300){ | |
//Do nothing within 300px and down range | |
} | |
else { | |
var spacerheight = $('header').height(); | |
if (iCurScrollPos > iScrollPos) { | |
//Scrolling Down |
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 | |
// Put this in functions file | |
function redirect_login_page() { | |
// Closes all forms going to Wordpress admin, make sure you got a form to login on this page because you'll be redirected to this page | |
$login_page = home_url( '/profiles/' ); | |
$page_viewed = basename($_SERVER['REQUEST_URI']); | |
if( $page_viewed == "wp-login.php" && $_SERVER['REQUEST_METHOD'] == 'GET') { | |
wp_redirect($login_page); | |
exit; | |
} |
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 | |
// Url | |
$link = 'http://www.google.com'; | |
//Get all meta tags and loop through them | |
if($link!=''){ | |
$sites_html = file_get_contents($link); | |
$html = new DOMDocument(); | |
@$html->loadHTML($sites_html); | |
$meta_og_img = null; | |
foreach($html->getElementsByTagName('meta') as $meta) { |