Skip to content

Instantly share code, notes, and snippets.

View paaljoachim's full-sized avatar

Paal Joachim Romdahl paaljoachim

View GitHub Profile
@paaljoachim
paaljoachim / css_resources.md
Last active August 29, 2015 14:19 — forked from jookyboi/css_resources.md
CSS libraries and guides to bring some order to the chaos.

Libraries

  • 960 Grid System - An effort to streamline web development workflow by providing commonly used dimensions, based on a width of 960 pixels. There are two variants: 12 and 16 columns, which can be used separately or in tandem.
  • Compass - Open source CSS Authoring Framework.
  • Bootstrap - Sleek, intuitive, and powerful mobile first front-end framework for faster and easier web development.
  • Font Awesome - The iconic font designed for Bootstrap.
  • Zurb Foundation - Framework for writing responsive web sites.
  • SASS - CSS extension language which allows variables, mixins and rules nesting.
  • Skeleton - Boilerplate for responsive, mobile-friendly development.

Guides

@paaljoachim
paaljoachim / welcome-panel-php
Last active January 23, 2020 13:46
Creating a new welcome Dashboard panel. I made a tutorial on adding a Dashboard widget: http://easywebdesigntutorials.com/creating-a-custom-dashboard-widget/
/*****************************
*Add a custom Welcome Dashboard Panel
*****************************/
function my_welcome_panel() {
?>
<div class="top-welcome-panel-content">
<div class="top-welcome-panel-logo" style="height: 120px; padding: 5px;text-align: center;">
<!-- Adds a logo top left-->
@paaljoachim
paaljoachim / Ninja-Forms-CSS.css
Last active November 15, 2020 06:00
Showing Ninja Forms HTML code and a styled CSS form.
/* STYLING NINJA FORMS - add to your stylesheet and adjust */
/* The full form */
#ninja_forms_form_1_wrap {
background-color: #f89a16;
padding: 20px;
border: 2px solid #ccc;
border-radius: 8px;
box-shadow: 0px 3px 5px #444;
@paaljoachim
paaljoachim / last-post-update.php
Last active August 29, 2015 14:27
Sometimes I will update a post and the following code snippets adds below the original date a message that says updated then the date I updated the post.
//* The following code was taken from: https://dl.dropboxusercontent.com/u/2503558/GenesisWP/code-snippets.html
//* and works only for child themes using the Genesis framework.
//*
//* Add last updated date to the post info in entry header
add_filter( 'genesis_post_info', 'sk_post_info_filter' );
function sk_post_info_filter($post_info) {
if (get_the_modified_time() != get_the_time()) {
$post_info = $post_info . '<br/>Last updated on: ' . the_modified_date('F j, Y', '', '', false);
}
@paaljoachim
paaljoachim / default-post-thumbnail.php
Created August 20, 2015 06:52
Define a post thumbnail with Genesis child themes.
//* Define a default post thumbnail
//* http://dreamwhisperdesigns.com/genesis-tutorials/genesis-default-thumbnails/
add_filter('genesis_get_image', 'default_image_fallback', 10, 2);
function default_image_fallback($output, $args) {
global $post;
if( $output || $args['size'] == 'full' )
return $output;
$thumbnail = CHILD_URL.'/images/WordPress-info150x150.jpg';
@paaljoachim
paaljoachim / remove-default-WP-widgets.php
Created August 20, 2015 07:05
The code snippet added to the functions.php file will remove the default WordPress widgets. I have commented the widgets I do not want to remove.
/* The below code removes all the default WordPress widgets. I commeted the ones I do not want to remove. */
// unregister all widgets
function unregister_default_widgets() {
unregister_widget('WP_Widget_Pages');
unregister_widget('WP_Widget_Calendar');
unregister_widget('WP_Widget_Archives');
unregister_widget('WP_Widget_Links');
unregister_widget('WP_Widget_Meta');
unregister_widget('WP_Widget_Search');
@paaljoachim
paaljoachim / global.js
Created August 24, 2015 09:49
Creating a sticky header.
// Adding code to create an effect on the header/nav on scroll
jQuery(function( $ ){
if( $( document ).scrollTop() > 0 ){
$( '.site-header' ).addClass( 'dark' );
}
// Add opacity class to site header
$( document ).on('scroll', function(){
@paaljoachim
paaljoachim / filed-under-categories
Last active February 13, 2016 15:45
Post preview and posts - Genesis code snippets
// Customize the post meta "FILED UNDER: -category name-" categories text and below the post preview in a blog page and change it at the bottom of a post.
// http://wordpress.stackexchange.com/questions/50961/removing-post-meta-from-category-pages */
//
add_filter( 'genesis_post_meta', 'sp_post_meta_filter' );
function sp_post_meta_filter($post_meta) {
if ( !is_page() ) {
if (is_archive() ) $post_meta = '';
else $post_meta = '[post_categories before="Categories: "] [post_tags before="Keywords: "]';
return $post_meta;
}}
//Altitude Pro customize.php code -
// Tutorial I am brushing up is here: http://easywebdesigntutorials.com/customizing-altitude-pro-genesis-child-theme/
<?php
/**
* Customizer additions.
*
* @package Altitude Pro
* @author StudioPress
* @link http://my.studiopress.com/themes/altitude/
@paaljoachim
paaljoachim / featured-images.php
Last active September 12, 2018 10:44
Set Featured image. 1. Sets the featured image. 2. If no featured image get image from category. 3. If no category image then get the first post image. 4. If no post image or category image then sets a fallback image.