Skip to content

Instantly share code, notes, and snippets.

View lori's full-sized avatar

Lori Berkowitz lori

View GitHub Profile
/**
* Template Redirect
* Use page_beaver.php for all static Pages.
*/
add_filter( 'template_include', 'custom_page_template', 99 );
function custom_page_template( $template ) {
if ( is_singular( 'page' ) ) {
$new_template = locate_template( array( 'page_beaver.php' ) );
if ( '' != $new_template ) {
<?php
function mrp_posts_fields( $posts_fields ) {
if ( is_main_query() ) {
$sticky_posts = get_option( 'sticky_posts' );
if ( is_array( $sticky_posts ) && ! empty( $sticky_posts ) ) {
$sticky_posts = implode( ', ', $sticky_posts );
@srikat
srikat / class-custom-featured-post.php
Last active April 3, 2022 16:29 — forked from GaryJones/readme.md
Custom Featured Posts Widget plugin: Skeleton for amending the output of the Genesis Featured Posts widget. https://sridharkatakam.com/custom-featured-post-widget-plugin/
<?php
/**
* Plugin Name
*
* @package Custom_Featured_Post_Widget
* @author Gary Jones
* @license GPL-2.0+
* @link http://gamajo.com/
* @copyright 2013 Gary Jones, Gamajo Tech
*/
@djrmom
djrmom / custom-hooks.php
Created June 20, 2018 15:06
facetwp move spaces to right
<?php
/** moves non-breaking spaces to right of fselect label **/
add_filter( 'facetwp_facet_html', function( $output, $params ) {
if ( 'my_facet_name' == $params['facet']['name'] ) { // replace 'my_facet_name' with name of your facet
$pattern = '/>([&nbsp;]+)([^<]+)/';
$output = preg_replace( $pattern, '>${2} ${1}', $output );
}
return $output;
}, 10, 2 );