Skip to content

Instantly share code, notes, and snippets.

@themebon
themebon / elements-to-center.css
Created December 27, 2016 10:25
Elements to Center
Another way (not mentioned here yet) is with Flexbox.
Just add the following code to the container element:
display: flex;
justify-content: center; /* align horizontal */
align-items: center; /* align vertical */
<?php
/**
* Enqueue scripts and styles.
*/
function tunu_scripts() {
/*
$font = esc_html(get_theme_mod('font'));
<?php
// Registering Custom Post
add_action( 'init', 'ultimate_hover_effects_custom_post' );
function ultimate_hover_effects_custom_post() {
register_post_type( 'ultimate-effects',
array(
'labels' => array(
'name' => __( 'U Hover Effects' ),
'singular_name' => __( 'Hover Item' ),
<?php
//Loading CSS
function ultimate_hover_effects_style() {
wp_enqueue_script('jquery');
wp_enqueue_style('uhe_default', plugins_url( '/css/default.css' , __FILE__ ) );
wp_enqueue_style('uhe_component', plugins_url( '/css/component.css' , __FILE__ ) );
wp_enqueue_script('uhe_modernizr_js', plugins_url( '/js/modernizr.custom.js' , __FILE__ ) );
wp_enqueue_script('uhe_toucheffects_js', plugins_url( '/js/toucheffects.js' , __FILE__ ) );
<?php
$q = new WP_Query(
array('posts_per_page' => -1, 'post_type' => 'hover_effect', 'p' => $id)
);
while($q->have_posts()) : $q->the_post();
<?php
/* ------------------------------------------------------------------------ */
/* Create Portfolio Template @@ single_template */
/* ------------------------------------------------------------------------ */
add_filter( 'single_template', 'delicious_portfolio_single' );
function delicious_portfolio_single($single_template) {
global $post;
<?php
add_shortcode('donation-posts', 'fnDonatePosts');
function fnDonatePosts($atts, $content = null) {
extract( shortcode_atts( array(
'id' => '',
'cat' => '',
'category_name' => '',
'num' => 6,
<?php
acf_form_head();
get_header();
// Show custom post fields in front end
acf_form(array(
'post_id' => 'new_post',
'new_post' => array(
'post_type' => 'movie',
'post_status' => 'publish'
@themebon
themebon / edd-license-activate.php
Last active June 10, 2019 18:19
Add EDD license system
<?php
$test_license = '';
$license_data = '';
define( 'DT_KEY', 'edd_sample_theme_license_key_status');
define( 'EDD_SL_STORE_URL', 'https://codenpy.com' ); /* IMPORTANT: Do not modify this line of code, the theme could stop working correctly */
define( 'EDD_SL_THEME_NAME', 'Industrue - Industrial & Factory WordPress Theme' ); /* IMPORTANT: Do not modify this line of code, the theme could stop working correctly */
if ( !class_exists( 'EDD_SL_Theme_Updater' ) ) {
include( dirname( __FILE__ ) . '/edd-class-file-here.php' );
}
@themebon
themebon / EDD_SL_Theme_Updater-Class.php
Created May 10, 2019 20:23
class that require edd license check
<?php
class EDD_SL_Theme_Updater {
private $remote_api_url;
private $request_data;
private $response_key;
private $theme_slug;
private $license_key;
private $version;
private $author;