Skip to content

Instantly share code, notes, and snippets.

View paaljoachim's full-sized avatar

Paal Joachim Romdahl paaljoachim

View GitHub Profile
@paaljoachim
paaljoachim / post meta
Created September 17, 2014 18:32
Customize the post meta function.
/* Customize the post meta function below the post AND remove it from category pages
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="Tagged: "]';
return $post_meta;
}}
@paaljoachim
paaljoachim / comment-notes-after
Last active September 25, 2021 08:33
Comments phrase adjustments - Genesis code snippets
// Add or remove notes after the comment box
//
add_filter( 'comment_form_defaults', 'sp_remove_comment_form_allowed_tags' );
function sp_remove_comment_form_allowed_tags( $defaults ) {
$defaults['comment_notes_after'] = 'An extra comment';
return $defaults;
}
@paaljoachim
paaljoachim / Another-file
Last active January 8, 2016 10:20
A test gist
Another file
@paaljoachim
paaljoachim / movie-custom-post-type
Last active August 29, 2015 14:15
Movie custom post type
<?php //* Mind this opening PHP tag
/**
* Register Movie Type
*
* @author Ren Ventura <EngageWP.com> - with some adjustments by Paal Joachim
* @link http://www.engagewp.com/nested-loops-custom-wordpress-queries
*/
add_action( 'init', 'rv_movie_cpt' );
@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
@paaljoachim
paaljoachim / add-link-top-admin-menu.php
Last active March 25, 2022 07:50
Adjusting the WordPress top admin toolbar
@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 / 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 / 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 / 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