Skip to content

Instantly share code, notes, and snippets.

View paaljoachim's full-sized avatar

Paal Joachim Romdahl paaljoachim

View GitHub Profile
@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 / 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 / welcome-panel-php
Last active February 13, 2025 18:21
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 / 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 / 0_reuse_code.js
Last active August 29, 2015 14:19
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@paaljoachim
paaljoachim / 1functions.php
Last active January 21, 2019 00:26
Custom Post Type - used in Executive Pro Genesis Child Theme
//* Custom Post type code used inside the functions.php file inside the Executive Pro Genesis child theme.
//* Create Portfolio Type custom taxonomy
add_action( 'init', 'executive_type_taxonomy' );
function executive_type_taxonomy() {
register_taxonomy( 'portfolio-type', 'portfolio',
array(
'labels' => array(
'name' => _x( 'Types', 'taxonomy general name', 'executive' ),
'add_new_item' => __( 'Add New Portfolio Type', 'executive' ),
@paaljoachim
paaljoachim / 1custom-post-type.php
Last active August 23, 2016 15:23
Custom Post Type - used in Minimum Pro Genesis Child Theme
//* Custom Post type code used inside the functions.php file inside the Minumum Pro Genesis child theme.
//* Create portfolio custom post type
add_action( 'init', 'minimum_portfolio_post_type' );
function minimum_portfolio_post_type() {
register_post_type( 'portfolio',
array(
'labels' => array(
'name' => __( 'Portfolio', 'minimum' ),
'singular_name' => __( 'Portfolio', 'minimum' ),
@paaljoachim
paaljoachim / excerpt-tinymce.php
Last active February 13, 2016 15:52
TinyMCE Excerpt snippet. An easier way to show a more stylized excerpt.
/************************** https://github.com/cosmic/cosmic-tinymce-excerpt
* Plugin Name: Cosmic TinyMCE Excerpt
* Description: TinyMCE pour les extraits
* Author: Agence Cosmic
* Author URI: http://agencecosmic.com/
* Version: 1.0
****************************/
function cosmic_activate_page_excerpt() {
add_post_type_support('page', array('excerpt'));
@paaljoachim
paaljoachim / add-link-top-admin-menu.php
Last active October 9, 2024 00:32
Adjusting the WordPress top admin toolbar
@paaljoachim
paaljoachim / archive-movie.php
Last active August 29, 2015 14:15
archive-movie
<?php
/**
* movie archive page
*
*/
//* Force full width content layout
add_filter( 'genesis_pre_get_option_site_layout', '__genesis_return_full_width_content' );
//* Remove the breadcrumb navigation