Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
I may be slow to respond.

Dragan Todorovic danyj

💭
I may be slow to respond.
View GitHub Profile
View gist:fcc8cc8d2681520695e8ee150cf55168
{
"a462b7d97f600cfdc7be74827590f666": {
"theme": "modern",
"skin": "lightgray",
"language": "en",
"formats": {
"alignleft": [
{
"selector": "p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li",
"styles": {
View gist:6db326913d4c1b0f0138b12abf584d23
$AndreiBday = '9-26-2016';
if ( date("m-d-Y") == $AndreiBday ) {
echo 'HAPPY BDAY';
} else {
echo 'Sh*t I\'m in trouble';
}
@danyj
danyj / settings.php
Created Dec 14, 2017
Unyson wp-shortcode bug check
View settings.php
<?php if ( ! defined( 'FW' ) ) {
die( 'Forbidden' );
}
/**
* Framework options
*
* @var array $options Fill this array with options to generate framework settings form in backend
*/
$options = array(
'main' => array(
View Thz-animation-class
<?php if (!defined('FW')) {
die('Forbidden');
}
class FW_Option_Type_Thzanimation extends FW_Option_Type
{
public function get_type()
{
return 'thz-animation';
}
View thz-animation view
<?php if ( ! defined( 'FW' ) ) { die( 'Forbidden' ); }
/**
* @var string $id
* @var array $option
* @var array $data
* @var array $inner_option
*/
{
View gist:1c719e347d0d710667111705c32ac2ff
<?php
//define('_JREQUEST_NO_CLEAN', 1);
define( '_JEXEC', 1 );
define( 'DS', DIRECTORY_SEPARATOR );
define('JPATH_BASE',str_replace(basename(dirname(__FILE__)),"",dirname(__FILE__)));
require_once ( JPATH_BASE .DS.'includes'.DS.'defines.php' );
require_once ( JPATH_BASE .DS.'includes'.DS.'framework.php' );
jimport( 'joomla.filesystem.file');
jimport( 'joomla.filesystem.folder' );
jimport( 'joomla.methods' );
View gist:2edb3d83bae4c363bf839f0dd5f1343f
function thz_create_missing_attachment_size( $attachment_id = false , $handle = false ){
if( !$handle ){
return wp_get_attachment_url( $attachment_id );
}
global $_wp_additional_image_sizes;
$default_image_sizes = get_intermediate_image_sizes();
View gist:009783f1513f342d318d73c993e2a36a
/**
* GA
*/
function _thz_action_add_ga(){
$GAcode = 'XX-XXXXXX-X'; // change with your GA tracking code
echo '<script async src="https://www.googletagmanager.com/gtag/js?id=UA-63305981-2"></script> <script> window.dataLayer = window.dataLayer || []; function gtag(){dataLayer.push(arguments);} gtag(\'js\', new Date()); gtag(\'config\', \''.$GAcode.'\'); </script>';
}
add_action('wp_footer', '_thz_action_add_ga');
View gist:9345fa171152c3f851117256caf93a5c
<?php
/**
* @package Thz Framework
* @author Themezly
* @websites http://www.themezly.com | http://www.youjoomla.com | http://www.yjsimplegrid.com
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // No direct access
}
@danyj
danyj / gist:797e36ddaceac64cffc7481717b6aa25
Last active Oct 15, 2018
Creatus WordPress Theme open popup on posts title click
View gist:797e36ddaceac64cffc7481717b6aa25
<script type="text/javascript">
(function($) {
$(document).ready(function($) {
$('.thz-grid-item-title').on('click',function(e){
e.preventDefault();
$(this).parents('.thz-grid-item-in').find('.thz-hover-icon').trigger('click');
});
});