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 | |
$gallery_loop = false; | |
$the_content = get_the_content(); // all content | |
$galleries = []; //Create empty figures array that will hold all of our parsed HTML data | |
while ($gallery_loop) { | |
$gallery = $the_content; // <figure .. </figure> | |
//<!-- wp:gallery {"ids":[742,739,737],"linkTo":"none"} --> | |
$cut_from = '<!-- wp:gallery'; |
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 = $_SERVER["REQUEST_URI"]; | |
// clear all cache | |
if ($url == '/cache/clear-all') { | |
array_map('unlink', glob("cache/*.html")); | |
exit('Cache clear 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
/** | |
In example make all images of website content (maybe insterted trough editor) | |
openable trough gallery | |
[this work with Blueimp Gallery https://github.com/blueimp/Gallery] | |
*/ | |
$(".auto-gallery-content").each(function(){ | |
var data_gallery = $(this).data("autoGallery") ? $(this).data("autoGallery") : "gallery"; | |
$("img", $(this)).each(function () { | |
if (!$(this).hasClass('no-auto-gallery')) { |
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
/** | |
* Replace mobile URL of WhatsApp with Desktop | |
* The mobile first strategy is used cause most people decide to not show WhatsApp on Desktop but only on mobile where it is very useful | |
* | |
* @dependencies [ core/w-ismobile.js ] | |
*/ | |
if(withOptions.whatsappWeb && !jQuery.browser.mobile && $(".whatsapp-weburl").length > 0){ | |
clog('WhatsApp Enabled and Present'); | |
clog($(".whatsapp-weburl")); |
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
/** | |
* Bootstrap 4 all media queries #wMQ | |
* https://getbootstrap.com/docs/4.5/layout/overview/ | |
* up > sm, md, lg, xl | |
* down < sm, md, lg | |
* only = xs, sm, lg, xl | |
* between <> sm-lg, sm-xl, md-xl | |
*/ | |
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
ga(function(tracker) { | |
var ga_refferer = tracker.get('referrer'); // this get the referral from google analytics.js | |
if (typeof wCookies != 'undefined' && typeof wCookies().get('ga_refferer') == 'undefined') { | |
if (typeof ga_refferer != 'undefined') { | |
wCookies().set('ga_refferer', ga_refferer, {expires: 30}); | |
} else { | |
wCookies().set('ga_refferer', 'direct', {expires: 30}); | |
} |
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
/** | |
* jQuery.browser.mobile (http://detectmobilebrowser.com/) | |
* | |
* jQuery.browser.mobile will be true if the browser is a mobile device | |
* | |
**/ | |
(function (a) { | |
(jQuery.browser = jQuery.browser || {}).mobile = /(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(a)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi( |
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
<!-- main.html (html input and js for open new window with elFinder for select file) --> | |
<input type="text" class="form-control" value="" id="idOfInput" onfocus="return openElFinder(event, 'idOfInput');"/> | |
<script> | |
$( document ).ready(function() { | |
window.input_id = ''; | |
window.openElFinder = function (event, input_id) { | |
event.preventDefault(); | |
window.single = 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
<?php | |
// refer for this gist for first steps that are trhe same: https://gist.github.com/arturmamedov/0b2e5b7e39c7e1de8fc09f69f79db618 | |
$parent_id = '1'; | |
// select all children sites | |
$sites = Site::where('parent_id', $parent_id)->get(); | |
//dd($sites); | |
$children_id = $sites->pluck('id'); | |
//dd($children_id); |
NewerOlder