Skip to content

Instantly share code, notes, and snippets.

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

Jay webmasterninjay

💭
I may be slow to respond.
View GitHub Profile
@webmasterninjay
webmasterninjay / gist:64de09b14e1cf209f15884038ff396be
Created February 24, 2017 15:49 — forked from srikat/gist:7853312
Showing Full content and Featured image in a CPT archive page regardless of theme settings in Genesis. http://sridharkatakam.com/showing-full-content-featured-image-cpt-archive-page-regardless-theme-settings-genesis/
//* Showing Full content and Featured image in 'testimonial' CPT archive page regardless of theme settings in Genesis
add_action( 'genesis_before_loop', 'sk_full_content_testimonials_archive' );
function sk_full_content_testimonials_archive() {
if ( is_post_type_archive( 'testimonial' ) ) {
add_filter( 'genesis_pre_get_option_content_archive_thumbnail', 'sk_show_post_image' );
add_filter( 'genesis_pre_get_option_content_archive', 'sk_do_full_content' );
add_filter( 'genesis_pre_get_option_content_archive_limit', 'sk_no_content_limit' );
}
jQuery('.video-thumb').click(function(){
var video = '<iframe width="573" height="322" src="'+ jQuery(this).attr('data-video') +'" frameborder="0" allowfullscreen></iframe>';
jQuery(this).replaceWith(video);
});
/*
* @data-video - use data-video attribute for video url
* @video-thumb - use 'video-thumb' class
* @example = <img class="video-thumb" src="/wp-content/uploads/2012/01/573x322.png" data-video="https://www.youtube.com/embed/MQ5sFO_iETg?autoplay=1" />
*/
@webmasterninjay
webmasterninjay / functions.php
Created October 19, 2016 16:18 — forked from srikat/functions.php
How to add an inline mobile responsive menu in Genesis Sample. https://sridharkatakam.com/add-inline-mobile-responsive-menu-genesis-sample/
// Remove site description
add_filter( 'genesis_attr_site-description', 'abte_add_site_description_class' );
/**
* Add class for screen readers to site description.
*
* Unhook this if you'd like to show the site description.
*
* @since 1.0.0
*
* @param array $attributes Existing HTML attributes for site description element.
@webmasterninjay
webmasterninjay / conkyrc
Created June 26, 2016 18:09
My Conky Script
use_xft yes
xftfont NotoSans:size=8
xftalpha 0.8
update_interval 1.0
total_run_times 0
own_window yes
own_window_transparent yes
own_window_argb_visual yes
own_window_type normal
own_window_class conky-semi
@webmasterninjay
webmasterninjay / goto.js
Created May 6, 2016 19:47
jQuery - On click, Go to ID
$(function() {
$('a[href*="#"]:not([href="#"])').click(function() {
if (location.pathname.replace(/^\//, '') == this.pathname.replace(/^\//, '') && location.hostname == this.hostname) {
var target = $(this.hash);
target = target.length ? target : $('[name=' + this.hash.slice(1) + ']');
if (target.length) {
$('html, body').animate({
scrollTop: target.offset().top
}, 1000);
return false;
@webmasterninjay
webmasterninjay / template_page.php
Created January 27, 2016 04:33
Genesis Theme: Custom Page Template with Custom Field
<?php
/**
* Template Name: Our Team Template
* Description: Used as a page template to display our team child pages
*/
//* Loop
remove_action('genesis_loop', 'genesis_do_loop');
add_action('genesis_loop', 'our_team_loop');
@webmasterninjay
webmasterninjay / remove-yoast-seo-nag.php
Created September 17, 2015 20:46
This plugin remove the annoying Yoast SEO nag in your wordpress dashboard every update.
<?php
/**
* Plugin Name: Remove Yoast SEO Nag
* Plugin URI: https://wordpress.org/
* Description: This plugin remove the annoying Yoast SEO nag in your wordpress dashboard every update.
* Version: 1.0.0
* Author: Jayson Antipuesto
* Author URI: https://wordpress.org/
*/
@webmasterninjay
webmasterninjay / widget.php
Last active September 15, 2015 19:30
wordpress optin form widget
<?php
class WendiePett_Optin extends WP_Widget {
/**
* Sets up the widgets name etc
*/
public function __construct() {
// widget actual processes
parent::__construct(
@webmasterninjay
webmasterninjay / functions.php
Created August 6, 2015 17:54
Enable woocommerce support on genesis
<?php
// Enable woocommerce support
add_theme_support( 'woocommerce' );
// Add WooCommerce support for Genesis layouts (sidebar, full-width, etc) - Thank you Kelly Murray
add_post_type_support( 'product', 'genesis-layouts' );
// Unhook WooCommerce Sidebar - use Genesis Sidebars instead
remove_action( 'woocommerce_sidebar', 'woocommerce_get_sidebar', 10 );
@webmasterninjay
webmasterninjay / functions.php
Created July 12, 2015 20:19
WordPress: Disable admin bar for non-admin user
<?php
//* Disable admin bar for non-admin user
function themeblvd_disable_admin_bar() {
if( ! current_user_can('edit_posts') )
add_filter('show_admin_bar', '__return_false');
}
add_action( 'after_setup_theme', 'themeblvd_disable_admin_bar' );