Skip to content

Instantly share code, notes, and snippets.

View danyj's full-sized avatar
💭
I may be slow to respond.

Dragan Todorovic danyj

💭
I may be slow to respond.
View GitHub Profile
{
"a462b7d97f600cfdc7be74827590f666": {
"theme": "modern",
"skin": "lightgray",
"language": "en",
"formats": {
"alignleft": [
{
"selector": "p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li",
"styles": {
$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 December 14, 2017 14:29
Unyson wp-shortcode bug check
<?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(
<?php if (!defined('FW')) {
die('Forbidden');
}
class FW_Option_Type_Thzanimation extends FW_Option_Type
{
public function get_type()
{
return 'thz-animation';
}
<?php if ( ! defined( 'FW' ) ) { die( 'Forbidden' ); }
/**
* @var string $id
* @var array $option
* @var array $data
* @var array $inner_option
*/
{
<?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' );
@danyj
danyj / gist:2edb3d83bae4c363bf839f0dd5f1343f
Last active February 25, 2018 18:56
Create missing image size
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();
@danyj
danyj / gist:009783f1513f342d318d73c993e2a36a
Last active July 23, 2018 08:45
Add Google Analytics
/**
* 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');
<?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 October 15, 2018 12:05
Creatus WordPress Theme open popup on posts title click
<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');
});
});