Skip to content

Instantly share code, notes, and snippets.

View morktron's full-sized avatar

Mark Law morktron

View GitHub Profile
@morktron
morktron / gist:3f1b5bfa7f0e407ef241
Last active August 29, 2015 14:16
Responsive tabs - embed into Wordpress
//* Enqueue files needed for Responsive-Tabs script
add_action( 'wp_enqueue_scripts', 'enqueue_responsive_tabs' );
function enqueue_responsive_tabs() {
if ( is_page('10' ) ):{
wp_enqueue_script( 'responsive-tabs', get_stylesheet_directory_uri() . '/javascript/responsiveTabs.min.js', array( 'jquery' ), '1.0.0', true );
wp_enqueue_script( 'responsive-tabs-init', get_stylesheet_directory_uri() . '/javascript/responsiveTabs.min.init.js', array( 'responsive-tabs' ), '1.0.0', true );
wp_enqueue_style( 'responsive-tabs-css', get_stylesheet_directory_uri() . '/css/responsive-tabs.css' );
}
@morktron
morktron / Genesis Copyright Footer
Created February 18, 2015 00:50
Change copyright footer for Genesis child theme, show current year
@morktron
morktron / gist:9221287
Last active August 29, 2015 13:56
Add css to Wordpress admin via child theme functions.php
<?php
// hide field table from all pages in admin except 'company profile'
add_action('admin_enqueue_scripts', 'my_hide_field_table_func');
function my_hide_field_table_func(){
$arr = array(74);
if(get_post_type() == 'page' && !in_array(get_the_ID(), $arr))
{
wp_enqueue_style( 'hide_field_table', bloginfo('stylesheet_directory').'/wp-content/themes/child-theme-name/custom-admin.css');
}
}
@morktron
morktron / functions.php
Created May 7, 2013 01:22
Add new widget areas to a Wordpress theme, then you must add some code to files where you want the widget or add them here via 'hooks'
<?php
function register_widget_area() {
add_action( 'widgets_init', 'register_widget_area' );
// Hero widget area
if( function_exists( 'register_sidebar' ) ) {
register_sidebar( array(
'name' => 'Hero Widget',