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
function main() { | |
const matchingFile = findFileByPattern(); | |
if (matchingFile) { | |
const excelFileId = importExcelToSheet(matchingFile); | |
} | |
} | |
function findFileByPattern() { | |
const folderId = '1f1fi3NA7JTw0OlRjBnmaxi-XrwvoQgK0'; | |
const folder = DriveApp.getFolderById(folderId); |
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
// Display Posts Shortcode below the content on single 'kbitem' CPT entries | |
add_action( 'genesis_after_loop', 'sk_display_more_entries' ); | |
function sk_display_more_entries() { | |
if ( ! is_singular( 'kbitem' ) ) { | |
return; | |
} | |
echo do_shortcode( '[display-posts post_type="kbitem" posts_per_page="5" title="More Knowledge Base Items"]' ); |
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 | |
// Reposition the primary navigation menu conditionally | |
add_action( 'genesis_before', 'sk_resposition_primary_nav' ); | |
function sk_resposition_primary_nav() { | |
// if we are not on a single Post page or archive page or search results page, abort. | |
if ( ! ( is_singular( 'post' ) || is_archive() || is_search() ) ) { | |
return; | |
} |
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
// Function to truncate post titles | |
function customTitle( $limit ) { | |
$title = get_the_title( $post->ID ); | |
if ( strlen( $title ) > $limit ) { | |
$title = substr( $title, 0, $limit ) . '...'; | |
} | |
return $title; |
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
@media only screen and (max-width: 860px) { | |
#front-page-3 .widget-area a.button { | |
padding: 12px 15px; | |
} | |
} |
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
// Show breadcrumbs (if enabled in Genesis theme settings) only on full-width-content pages | |
add_action( 'genesis_before_content', 'sk_conditional_breadcrumbs' ); | |
function sk_conditional_breadcrumbs() { | |
// get the page layout | |
$site_layout = genesis_site_layout(); | |
// if the page uses full-width-content layout, abort. | |
if ( 'full-width-content' == $site_layout ) { | |
return; |
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
// Remove site description | |
add_filter( 'genesis_attr_site-description', 'abte_add_site_description_class' ); | |
/** | |
* Add class for screen readers to site description. | |
* | |
* Unhook this if you'd like to show the site description. | |
* | |
* @since 1.0.0 | |
* | |
* @param array $attributes Existing HTML attributes for site description element. |
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
// Removes 'header-image' class from the body_class array | |
add_filter( 'body_class', 'remove_class' ); | |
function remove_class( $classes ) { | |
// search the array for the class to remove | |
$unset_key = array_search( 'header-image', $classes ); | |
if ( false !== $unset_key ) { | |
// unsets the class if the key exists | |
unset( $classes[$unset_key] ); |
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( 'body_class', 'sk_body_class_for_pages' ); | |
/** | |
* Adds a css class to the body element | |
* | |
* @param array $classes the current body classes | |
* @return array $classes modified classes | |
*/ | |
function sk_body_class_for_pages( $classes ) { | |
if ( is_singular( 'page' ) ) { |
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 | |
/** | |
* Plugin Name: Genesis Boilerplate | |
* Plugin URI: http://example.com/ | |
* Description: Write what the plugin does. Must be using the Genesis theme. | |
* Author: Your Name | |
* Author URI: http://example.com/ | |
* Version: 1.0 | |
* Text Domain: genesis-boilerplate | |
* |
NewerOlder