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 | |
remove_action( 'genesis_archive_title_descriptions', 'genesis_do_archive_headings_headline', 10, 3 ); | |
add_action( 'genesis_archive_title_descriptions', 'custom_do_archive_headings_headline', 10, 3 ); | |
/** | |
* Adapts archive title to display a date even for days in custom post types that have no posts. | |
* | |
* @param string $heading Optional. Archive heading, default is empty string. | |
* @param string $intro_text Optional. Archive intro text, default is empty string. | |
* @param string $context Optional. Archive context, default is empty string. | |
*/ |
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 Portfolio Pro Modifications | |
Description: Enable the Block Editor for the Portfolio post type. | |
Version: 1.0.0 | |
*/ | |
add_filter( 'register_post_type_args', 'studiopress_enable_block_editor_portfolio', 10, 2 ); | |
function studiopress_enable_block_editor_portfolio( $args, $post_type ) { |
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_action( 'wp_enqueue_scripts', 'studiopress_load_newer_vimeo_mediaelement', 100 ); | |
/** | |
* Replace the mediaelement-vimeo script with a newer version. | |
* | |
* This works around an issue in WordPress core that can prevent playback of | |
* Vimeo videos embedded via the `wp_video_shortcode()` function. | |
* | |
* This is caused by WordPress loading an older version of the Vimeo script | |
* (currently loads 4.2.6), which does not add the 'allow=autoplay' | |
* attribute to iframes that Chrome now requires to permit video playback as |
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 | |
/** | |
* Genesis Sample. | |
* | |
* Onboarding config to load plugins and homepage content on theme activation. | |
* | |
* @package Genesis Sample | |
* @author StudioPress | |
* @license GPL-2.0-or-later | |
* @link https://www.studiopress.com/ |
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( 'genesis_post_title_output', 'sp_link_post_format_title' ); | |
/** | |
* If the post uses the “Link” post format and has a URL in the content, | |
* link the title directly to that URL instead of to the post itself. | |
* | |
* @param string $title_html The original title HTML. | |
* @return string The updated HTML. | |
*/ | |
function sp_link_post_format_title( $title_html ) { | |
if ( get_post_format() !== 'link' ) { |
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 | |
add_filter( 'render_block', 'custom_wrap_html_block_output', 10, 2 ); | |
/** | |
* Wrap output of HTML blocks. | |
* | |
* @param string $block_content Original block content. | |
* @param array $block Block info. | |
* @return string The block content with a wrapper. | |
*/ |
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 // omit this line from functions.php | |
add_filter( 'pre_get_posts', 'custom_remove_portfolio_taxonomy' ); | |
function custom_remove_portfolio_taxonomy( $query ) { | |
if ( is_post_type_archive( 'portfolio' ) && $query->is_main_query() ) { | |
$tax_query = array( | |
array( | |
'taxonomy' => 'portfolio-type', | |
'field' => 'slug', | |
'terms' => array( 'type1', 'type2' ), // Change this to use the portfolio taxonomies you want to exclude. |
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
set fish_user_paths $fish_user_paths my_path | |
From https://github.com/fish-shell/fish-shell/issues/527#issuecomment-32237807. |
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 | |
add_filter( 'genesis_get_robots_meta_content', 'sp_noindex_paginated_front_page' ); | |
/** | |
* No-index paginated front-page if Genesis SEO is in use. | |
* | |
* @param array $directives The robots directives. | |
* @return array The directives with noindex set if on a paginated front page. | |
*/ | |
function sp_noindex_paginated_front_page( $directives ) { | |
if ( is_front_page() && is_paged() ) { |
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 | |
/* Remove Genesis post layouts metabox if template matches 'custom-layout.php'*/ | |
add_action( 'admin_menu', 'custom_remove_custom_layouts' ); | |
function custom_remove_custom_layouts() { | |
$template_file = get_post_meta( $_GET['post'], '_wp_page_template', true ); | |
if ( $template_file == 'custom-layout.php' ) { | |
remove_action( 'admin_menu', 'genesis_add_inpost_layout_box' ); | |
} |