This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Template Name: No-Image Header | |
* Template Post Type: post, page | |
* | |
* | |
* @package GeneratePress | |
*/ | |
if ( ! defined( 'ABSPATH' ) ) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_filter( 'facetwp_facet_html', 'local_per_page', 10, 2); | |
function local_per_page ( $output, $params ) { | |
if ( 'pager' == $params['facet']['type'] ) { | |
$output = str_replace( 'class="facetwp-per-page-select"', 'class="facetwp-per-page-select" aria-label="Per Page Options"', $output ); | |
} | |
return $output; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// AUTOMATICALLY ADD ALT TAGS TO IMAGES | |
add_filter('the_content', 'add_alt_tags', 99999); | |
function add_alt_tags($content) | |
{ | |
global $post; | |
preg_match_all('/<img (.*?)\/>/', $content, $images); | |
if(!is_null($images)) | |
{ | |
foreach($images[1] as $index => $value) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"key": "group_5a0cb501d0249", | |
"title": "Location & Hours", | |
"fields": [ | |
{ | |
"key": "field_5a0cb50f1fae4", | |
"label": "Header Hours & Location info", | |
"name": "header_hours", | |
"type": "wysiwyg", | |
"instructions": "", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@import "breakpoints"; // for bp mixin see https://snippets.cacher.io/snippet/fc10ef4581746c8e4b96 | |
$margin-right: 4.7619%; /* this is % equiv of 40px/2.5rem, but it could be anything. */ | |
.wp-block-columns { | |
$wrap: &; | |
display:flex; | |
flex-direction: row; | |
flex-wrap:wrap; | |
margin:0 -#{$margin-right} 0 0; | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/********************* | |
Breakpoints | |
*********************/ | |
/* usage: @include bp(tablet) { // your styles here } */ | |
@mixin bp($point) { | |
@if $point == widescreen { // 1440px | |
@media (min-width: 90em) { @content ; } | |
} | |
@elseif $point == tv { // 1300px | |
@media (min-width: 81.25em) { @content ; } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// IF USING CUSTOM PERMALINKS LIKE CATEGORY/POSTNAME, PAGE NAVIGATION BREAKS ON PAGE 2. THIS IS THE FIX | |
// from http://barefootdevelopment.blogspot.com/2007/11/fix-for-wordpress-paging-problem.html | |
add_filter('request', 'remove_page_from_query_string'); | |
function remove_page_from_query_string($query_string) { | |
if ($query_string['name'] == 'page' && isset($query_string['page'])) { | |
unset($query_string['name']); | |
// 'page' in the query_string looks like '/2', so split it out | |
list($delim, $page_index) = split('/', $query_string['page']); | |
$query_string['paged'] = $page_index; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// See if "posts page" is set in Settings > Reading, aka is_home() | |
// If it is, display this page's title before the posts | |
$page_for_posts = get_option( 'page_for_posts' ); | |
if ($page_for_posts) { ?> | |
<header class="page-header"> | |
<h1 class="page-title" itemprop="headline"> | |
<?php echo get_queried_object()->post_title; ?> | |
</h1> | |
</header> <?php // end article header ?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_shortcode('sidebar-menu','fwp_simplesidenav'); | |
function fwp_simplesidenav( $atts, $content = null) { | |
global $post; | |
$current_page = $post->ID; | |
extract( shortcode_atts( array( | |
'exclude' => '', | |
'exclude_children_of' => '', | |
'exclude_tree' => '', | |
'children_of' => $current_page, |
NewerOlder