Skip to content

Instantly share code, notes, and snippets.

View paaljoachim's full-sized avatar

Paal Joachim Romdahl paaljoachim

View GitHub Profile
@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
@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 / Another-file
Last active January 8, 2016 10:20
A test gist
Another file
@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 / 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;
}}