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 get_page_depth($post) { | |
$parent_id = $post->post_parent; | |
$depth = 0; | |
while ($parent_id > 0) { | |
$page = get_page($parent_id); | |
$parent_id = $page->post_parent; | |
$depth++; | |
} | |
return $depth; |
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
RewriteEngine on | |
RewriteCond $1 !^(index\.php|resources|robots\.txt) | |
RewriteCond %{REQUEST_FILENAME} !-f | |
RewriteCond %{REQUEST_FILENAME} !-d | |
RewriteRule ^(.*)$ index.php/$1 [L,QSA] | |
AddDefaultCharset utf-8 | |
AddType image/svg+xml svg svgz | |
AddEncoding gzip svgz |
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
window.scrollStopper = (function () { | |
var obj = {} | |
obj.keys = [ | |
37, 38, 39, 40 | |
]; | |
obj.preventDefault = function (e) { | |
e = e || window.event; | |
if (e.preventDefault) { | |
e.preventDefault(); | |
} |
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
//Your frontend javascript | |
var data = { | |
action: 'sign_in', | |
username:"<username>", | |
pass:"<password>" | |
}; | |
jQuery.post('/wordpress/wp-admin/admin-ajax.php', data, | |
function(response) { | |
alert("signed in successfully"); |
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
/*if($post has condition) { | |
redirect_first_child($post->ID); | |
}*/ | |
function redirect_first_child($post_id) { | |
$pagekids = get_pages("child_of=".$post_id."&sort_column=menu_order"); | |
if ($pagekids) { | |
$firstchild = $pagekids[0]; | |
wp_redirect(get_permalink($firstchild->ID)); | |
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
var isEmail = function(a){return (/^[\w\.%\+\-]+@(?:[A-Z0-9\-]+\.)+(?:[A-Z]{2,6})$/i).test(a);}; |
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 printcontent(content) | |
{ | |
var mywindow = window.open('', '', ''); | |
mywindow.document.write('<html><title>Print</title><body>'); | |
mywindow.document.write(content); | |
mywindow.document.write('</body></html>'); | |
mywindow.document.close(); | |
mywindow.print(); | |
return true; | |
} |
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 hashval = location.hash.replace('#', '').substring(0, location.hash.indexOf('?')-1); |
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 hasCanvas() | |
{ | |
return !!document.createElement('canvas').getContext; | |
} |
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
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text.RegularExpressions; | |
using System.Web; | |
using umbraco.BusinessLogic; | |
using umbraco.NodeFactory; | |
namespace Web.Modules | |
{ |
NewerOlder