Skip to content

Instantly share code, notes, and snippets.

View MatRouault's full-sized avatar
🏠
Working from home

Mathieu MatRouault

🏠
Working from home
View GitHub Profile
@MatRouault
MatRouault / add_subheader.php
Last active April 23, 2016 19:01
Beans - Add a sub-header on category archive page
<?php
// Do not include the opening php tag if it is already included in your file.
//* Add a sub-header on category archive page
add_action( 'beans_header_after_markup', 'sps_add_archive_under_header' );
function sps_add_archive_under_header () {
if ( !is_archive() )
return;
@MatRouault
MatRouault / beans-ninja-forms.php
Last active April 24, 2016 10:23
Beans - Adapt Ninja Forms for UiKit
<?php
// Do not include the opening php tag if it is already included in your file.
//* Note : A good practice is to load this snippet only if the plugin is activated.
//* Add this in your functions.php and the snippet in itself in a separate file.
// include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
// if( is_plugin_active( 'ninja-forms/ninja-forms.php' ) ) {
// include_once( get_stylesheet_directory() . '/lib/beans-ninja-forms.php' );
// }
@MatRouault
MatRouault / related-posts.php
Last active May 20, 2018 18:12
Related Posts for Beans Framework
@MatRouault
MatRouault / frontpage-slideshow.php
Last active May 12, 2016 21:21
Frontpage with a post slideshow in Beans Framework
/* REF : Mike Hopkins / See : https://community.getbeans.io/discussion/frontpage-with-a-post-slideshow */
add_action( 'beans_main_prepend_markup', 'post_slider' );
function post_slider() {
$query = new WP_Query( array(
'category_name' => 'featured',
'paged' => get_query_var( 'paged' ),
'nopaging' => false
@MatRouault
MatRouault / change-beans-loop.php
Created July 26, 2016 06:19
Replace the entire loop with your own and use Beans post fragment functions in your HTML
<?php
//*https://community.getbeans.io/discussion/customize-post-view-on-index-php/#post-1737
beans_modify_action_callback( 'beans_loop_template', 'example_loop' );
function example_loop() {
if ( have_posts() && !is_404() ) : while ( have_posts() ) : the_post(); ?>
@MatRouault
MatRouault / beans-human-time.php
Created July 27, 2016 15:10
Change the post meta date/time to human difference format.
<?php
//https://community.getbeans.io/discussion/pretty-date/#post-1975
// Change the post meta date prefix.
add_filter( 'beans_post_meta_date_prefix_output', 'example_post_meta_date_prefix' );
function example_post_meta_date_prefix() {
echo 'Posted: ';
https://community.getbeans.io/discussion/off-canvas-menus/#post-476
add_filter( 'beans_layout_grid_settings', 'example_modify_grid' );
function example_modify_grid( $args ) {
return array_merge( $args, array(
'grid' => 6,
'sidebar_primary' => 1,
'sidebar_secondary' => 1,
@MatRouault
MatRouault / beans-fullwidth-post.php
Created October 3, 2016 20:51
Fullwidth post with featured image with overlay effect
<?php
add_action( 'wp', 'sps_custom_output' );
function sps_custom_output() {
if ( is_singular ( array ('post') ) ) {
/* Featured Image with Background Effect */
beans_add_attribute( 'beans_post_header', 'class', 'uk-cover-background uk-position-relative uk-contrast' );
@MatRouault
MatRouault / functions.php
Last active October 5, 2016 21:34 — forked from ThierryA/functions.php
Beans: split post image/content in two columns.
<?php
// Do not include the opening php tag if it is already included in your file.
add_action( 'wp', 'beans_child_setup_document' );
function beans_child_setup_document() {
// Only apply to non-singular layouts.
if ( !is_singular() ) {