Skip to content

Instantly share code, notes, and snippets.

View nickcernis's full-sized avatar

Nick Cernis nickcernis

  • Innsbruck, Austria
  • 08:27 (UTC +02:00)
View GitHub Profile
<!-- Use this button code in your Home Section 1 text widget to point to your Real Music Rocks section: -->
<a class="button" href="#" data-section="home-section-2">Continue Reading</a>
<!-- Use this button code in the Home Section 2 text widget to point to the Your Favorite Songs Matter section: -->
<a class="button" href="#" data-section="home-section-3">Continue Reading</a>
<!-- Use this button code in the Home Section 3 text widget to point to the Event Schedule section: -->
<a class="button" href="#" data-section="home-section-4">Event Schedule</a>
<!-- Finally, you can use this button code in the Footer 1 text widget to send visitors to your contact page: -->
@nickcernis
nickcernis / functions.php
Created December 31, 2014 16:18
Add author and updated hatom data to posts and pages
<?php
//Add hAtom data to all posts and pages
function sp_hatom_data($content) {
$t = get_the_modified_time('F jS, Y');
$author = get_the_author();
$title = get_the_title();
$content .= '<div class="hatom-extra" style="display:none;visibility:hidden;"><span class="entry-title">'.$title.'</span> was last modified: <span class="updated"> '.$t.'</span> by <span class="author vcard"><span class="fn">'.$author.'</span></span></div>';
return $content;
}
add_filter('the_content', 'sp_hatom_data');
<?php
/**
* Change the post order for listings
*
* @author Carrie Dils
* @link http://www.billerickson.net/customize-the-wordpress-query/
* @reference http://codex.wordpress.org/Class_Reference/WP_Query
*
*/
@nickcernis
nickcernis / functions.php
Last active August 29, 2015 14:21
Replace Genesis favicon with full favicon set
<?php // Copy everything except for this first line
// Favicons generated by realfavicongenerator.net
// These should be added in wp-content/themes/child-theme/images/favicons/
remove_action('wp_head', 'genesis_load_favicon');
add_action('wp_head', 'custom_favicon');
function custom_favicon(){
?>
@nickcernis
nickcernis / plugin.php
Created August 17, 2015 13:54
Don't process a WordPress shortcode in wp_head
<?php
global $wp_current_filter;
// Don't process this shortcode in wp_head. This typically happens if a plugin author
// uses apply_filters( 'the_content', $content ) for the meta description tag output,
// instead of using strip_shortcodes() like a sane person. Processing shortcodes in
// the head might be undesirable if your shortcode counts the number of times it's
// been used for the purpose of outputting unique class names or IDs, for example.
if ( in_array('wp_head', $wp_current_filter) ) {
@nickcernis
nickcernis / functions.php
Created August 18, 2015 18:56
Force the Page Builder plugin to include the correct class for Simple Social Icons to be rendered more accurately
<?php
// Force the Page Builder plugin to include 'simple-social-icons' in its widget wrapper class
add_filter( 'siteorigin_panels_widget_classes', 'ssi_add_widget_class' );
function ssi_add_widget_class( $classes ) {
if ( in_array( 'widget_simple-social-icons', $classes ) ) {
$classes[] = 'simple-social-icons';
}
return $classes;
}
@nickcernis
nickcernis / footer.html
Last active September 15, 2015 18:38
Workaround for Parallax section scrolling on Rainmaker sites. Allows creation of click-to-advance “Continue Reading” buttons.
@nickcernis
nickcernis / functions.php
Created December 15, 2014 12:31
Change the Property Details labels in the AgentPress Pro theme
<?php // Remove the opening PHP tag before pasting to functions.php
add_filter( 'agentpress_property_details', 'custom_agentpress_property_details_filter' );
// Filter the property details array for property listings
// Replace labels such as "ZIP" with "Postcode" etc.
function custom_agentpress_property_details_filter( $details ) {
$details['col1'] = array(
__( 'Price:', 'apl' ) => '_listing_price',
@nickcernis
nickcernis / init.sls
Created July 30, 2013 14:03
PHP 5.2.17 stack
# /srv/salt/php/init.sls
php:
pkgrepo.managed:
- ppa: skettler/php # https://launchpad.net/~skettler/+archive/php/+packages
- require_in:
- pkg: php
pkg.installed:
- name: php52
- version: 5.2.17~precise~ppa19
/* Author Box
------------------------------------------------------------ */
.author-box {
background-color: #f5f5f5;
border: 1px solid #ddd;
margin: 0 0 40px;
overflow: hidden;
padding: 10px;
}