Skip to content

Instantly share code, notes, and snippets.

@SiGaCode
SiGaCode / no-posts-customtext.php
Created May 24, 2017 15:21
Change the "no posts found" text in Genesis to a custom text
add_filter('genesis_noposts_text', 'sg_noposts_text');
function sg_noposts_text($text)
{
$text = '<span class="noposts-text">' . __('Ups, didn´t find any posts.', 'sg') . '</span>';
return $text;
}
@SiGaCode
SiGaCode / ace-comment-color.php
Created April 17, 2017 16:21
Customize the color of Dynamik ACE editor commented code, change it to grey (instead of green). Goes to Dynamik Custom - Functions or the skin PHP file, whatever you prefer.
//* Customize the color of ACE commented code, change it to grey
add_action('admin_head', 'custom_ace_css');
function custom_ace_css() {
echo '<style>
.ace-tm .ace_comment {
color: #b2b2b2;
}
</style>';
}
@SiGaCode
SiGaCode / disable_wpautop_plugin.php
Last active June 16, 2017 14:50
"Here’s a plugin I’ve come up with to disable wpautop on specific posts/pages." From: https://grahamwalters.me/lab/disable-wpautop-on-specific-postspages/ You can place the above code in a file called disable_wpautop.php and upload it to your plugins folder. How do you use it? Easy, you simply add a custom field: Name: wpautop Value: false Secon…
<?php
/*
* Plugin Name: Disable wpautop
* Plugin URI: https://grahamwalters.me/2014/03/07/disable-wpautop-on-specific-postspages/
* Author: Graham Walters
* Author URI: https://grahamwalters.me
* Version: 1.1
* Description: Disable wpautop on posts/pages with custom field 'wpautop' == false.
*/
@SiGaCode
SiGaCode / media-url.php
Created February 10, 2017 10:40
Creates a URL column in the media library so you don´t have to open the item to copy it. Goes to childtheme function.php (Dynamik: Dynamik Custom - Functions or skin PHP file). Credits: Sridhar Katakam. https://sridharkatakam.com/add-url-admin-column-wordpress-media-library/
add_filter( 'manage_media_columns', 'sk_media_columns_url' );
/**
* Filter the Media list table columns to add a URL column.
*
* @param array $posts_columns Existing array of columns displayed in the Media list table.
* @return array Amended array of columns to be displayed in the Media list table.
*/
function sk_media_columns_url( $posts_columns ) {
$posts_columns['media_url'] = 'URL';
return $posts_columns;
@SiGaCode
SiGaCode / headermenu-left.css
Created January 25, 2017 15:24
Float the header menu left and the title area (logo) right. Credits: Eric Hamm. https://gist.github.com/cobaltapps/2df81b9cff46b40531457895b867318d
.title-area {
float: right;
}
.site-header .widget-area {
float: left;
text-align: left;
}
@SiGaCode
SiGaCode / accordion2-script.js
Last active January 23, 2017 12:00
Another simple jQuery accordion. Responsive, very basic styles, should inherit a lot of Dynamik CSS. Edit to meet your needs.
jQuery(document).ready(function($) {
$(".accordion h3").click(function() {
// For active header definition
$('.accordion h3').removeClass('active');
$(this).addClass('active');
// Accordion actions
if($(this).next("div").is(":visible")){
$(this).next("div").slideUp(400);
$(this).removeClass('active');
@SiGaCode
SiGaCode / accordion-script.js
Last active January 23, 2017 10:32
A simple jQuery accordion for implementation in Dynamik. Codepen: https://codepen.io/SiGa/pen/apWgrv Edit the styles to your liking!
// A simple jQuery accordion
(function($) {
// run the accordion
var allPanels = $('.accordion .content').hide();
var heads = $('.accordion header');
$('header').on('click', function() {
$this = $(this);
$target = $this.parent().find('div');
if(!$target.hasClass('active')){
heads.removeClass('selected');
@SiGaCode
SiGaCode / widget-primary-nav-css.css
Created January 10, 2017 18:42
Add a widget area (for social icons in this example) to primary nav. Credits: Sridhar Katakam. https://gist.github.com/srikat/8171174#file-functions-php-L4
/* Just samples, might not fit for your childtheme. Adjust for your needs! */
.genesis-nav-menu .widget {
float: right;
}
.genesis-nav-menu .simple-social-icons ul li {
margin-bottom: 0 !important;
margin-top: 0.7rem !important;
}
@SiGaCode
SiGaCode / search-in-menu.php
Created October 19, 2016 10:57
Add animated search to primary menu.
add_filter( 'wp_nav_menu_items', 'theme_menu_extras', 10, 2 );
/**
* Filter menu items to append a search form.
*
* @param string $menu HTML string of list items.
* @param stdClass $args Menu arguments.
*
* @return string Amended HTML string of list items.
*/
function theme_menu_extras( $menu, $args ) {
@SiGaCode
SiGaCode / ez-rows.css
Created October 15, 2016 21:10
Make EZ home wrapping divs go full width to look like rows while content stays usual width and centered, color the middle row.
.ez-home .site-inner, #home-hook-wrap, #home-hook-wrap,
#ez-home-top-container, #ez-home-middle-container, #ez-home-bottom-container {
max-width: 100%;
padding:0;
}
#ez-home-top-container .ez-home-wrap, #ez-home-middle-container .ez-home-wrap, #ez-home-bottom-container .ez-home-wrap {
float:none;
margin: 0 auto;
padding: 50px 20px;
}