Skip to content

Instantly share code, notes, and snippets.

View duroe5698's full-sized avatar

Marc Duroe duroe5698

View GitHub Profile
@duroe5698
duroe5698 / get-shortened-meta-excerpt-with-tags-stripped-wordpress.php
Created November 28, 2015 19:01
Get Shortened Meta Excerpt With Tags Stripped Wordpress.php
<?php
echo wpautop(substr(strip_tags(( get_post_meta( get_the_ID(), 'GET CUSTOM META FIELD ID', true ) )), 0,200) . '...');
?>
@duroe5698
duroe5698 / add-genesis-after-entry-widget-on-pages-genesis-wordpress.php
Created November 25, 2015 17:34
Add Genesis After Entry Widget on Pages Genesis WordPress
<?php
add_action( 'genesis_after_entry', 'md_after_entry_widget_area' );
/*Display after-entry widget area on the genesis_after_entry action hook.*/
function md_after_entry_widget_area() {
if ( ! is_singular( 'page' ) || ! current_theme_supports( 'genesis-after-entry-widget-area' ) ) {
return;
}
genesis_widget_area( 'after-entry', array(
@duroe5698
duroe5698 / simple-lightweight-jquery-accordion.css
Created November 25, 2015 17:18
Simple Lightweight jQuery Accordion for WordPress
/* --------------------------------------------
Accordion Styles
----------------------------------------------*/
.accordion { margin: 0 0 30px; border-top: 1px solid #DDD; border-right: 1px solid #DDD; border-left: 1px solid #DDD; -webkit-border-radius: 4px; -moz-border-radius: 4px; border-radius: 4px; }
.accordion dt { border-bottom: 1px solid #DDD; }
.accordion dd { display: none; padding: 20px; border-bottom: 1px solid #DDD; }
@duroe5698
duroe5698 / remove-cpt-name-slug-from-permalink-wordpress.php
Last active November 25, 2015 17:19
Remove CPT Name Slug From Permalink WordPress
@duroe5698
duroe5698 / add-custom-header-support-wordpress-genesis.php
Last active November 25, 2015 17:20
Add Custom Header Support WordPress Genesis
<?php
add_theme_support( 'custom-header', array(
'header-selector' => '.site-title a',
'header-text' => false,
'height' => 157,
'width' => 1200,
) );
?>
@duroe5698
duroe5698 / custom-home-page-template-wordpress-genesis.php
Last active November 25, 2015 17:20
Custom Homepage Template WordPress Genesis
<?php
add_action( 'genesis_meta', 'md_home_genesis_meta' );
/**
* Add custom loop/widget support for homepage. File name should be home.php
*
*/
function md_home_genesis_meta() {
//* Add md-home body class
@duroe5698
duroe5698 / custom-wordpress-genesis-loop-widget.php
Last active November 25, 2015 17:20
Custom WordPress Genesis Loop Widget
<?php
class YOURCUSTOMWidget extends WP_Widget
{
function YOURCUSTOMWidget()
{
$widget_ops = array('classname' => 'YOURCUSTOMWidget', 'description' => 'Widget Description' );
parent::__construct('YOURCUSTOMWidget', 'YOURCUSTOM Widget', $widget_ops);
}
function form($instance)
@duroe5698
duroe5698 / match-sidebar-to-content-height-genesis.js
Last active June 21, 2016 19:34
Match sidebar to content height Genesis
jQuery(function($){
var h = document.querySelector('.content').offsetHeight;
document.querySelector('.sidebar-primary').style.height = h + "px";
});
@duroe5698
duroe5698 / hide-wordpress-plugin-update-notice.php
Last active November 25, 2015 17:21
Hide WordPress plugin update notice from admin
<?php
function md_filter_plugin_updates( $value ) {
if( isset( $value->response[ plugin_basename(__FILE__) ] ) )
unset( $value->response[ plugin_basename(__FILE__) ] ); //Duplicator
return $value;
}
add_filter( 'site_transient_update_plugins', 'md_filter_plugin_updates' );
?>
@duroe5698
duroe5698 / Relocating entry-title-below-header-in-genesis-functions.php
Last active November 25, 2015 17:21
Relocating Entry Title below Header in Genesis
<?php
// * Relocate titles on Page, Post and other single pages
add_action( 'genesis_after_header','relocate_entry_title_singular' );
function relocate_entry_title_singular() {
if ( ! is_singular() )
return;
echo '<div class="entry-header-wrapper"><div class="wrap">';
genesis_do_post_title();
genesis_post_info();