This file contains hidden or 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', 'tu_remove_header_from_products' ); | |
function tu_remove_header_from_products() { | |
if ( is_singular( 'product' ) ) { | |
remove_action( 'generate_header', 'generate_construct_header' ); | |
} | |
} |
This file contains hidden or 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( 'generate_page_header_options', 'tu_default_featured_image' ); | |
function tu_default_featured_image( $options ) { | |
if ( '' == $options['image_id'] ) { | |
$options['image_id'] = 4667; | |
} | |
return $options; | |
} |
This file contains hidden or 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','tu_move_nav_after_page_header' ); | |
function tu_move_nav_after_page_header() { | |
if ( ! function_exists( 'generate_page_header_get_options' ) ) { | |
return; | |
} | |
$options = generate_page_header_get_options(); | |
if ( '' !== $options['content'] ) { | |
remove_action( 'generate_after_header', 'generate_add_navigation_after_header', 5 ); |
This file contains hidden or 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( 'admin_head', 'tu_show_gridable_button_sections' ); | |
function tu_show_gridable_button_sections() { | |
?> | |
<style> | |
#wp-generate-sections-editor-wrap .wp-media-buttons > .gridable-insert-row-button { | |
display: inline-block; | |
} | |
</style> | |
<?php | |
} |
This file contains hidden or 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( 'generate_post_date_output', 'tu_show_modified_date' ); | |
function tu_show_modified_date() { | |
$time_string = '<time class="entry-date published" datetime="%1$s" itemprop="datePublished">%2$s</time>'; | |
if ( get_the_time( 'U' ) !== get_the_modified_time( 'U' ) ) { | |
$time_string = 'Updated on: <time class="updated" datetime="%3$s" itemprop="dateModified">%4$s</time>'; | |
} | |
$time_string = sprintf( $time_string, | |
esc_attr( get_the_date( 'c' ) ), |
This file contains hidden or 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( 'generate_post_author_output', 'tu_categories_to_author' ); | |
add_filter( 'generate_category_list_output', '__return_false' ); | |
add_filter( 'generate_tag_list_output', '__return_false' ); | |
function tu_categories_to_author( $output ) { | |
$categories_list = get_the_category_list( _x( ', ', 'Used between list items, there is a space after the comma.', 'generatepress' ) ); | |
$categories_list = sprintf( '<span class="cat-links"><span class="screen-reader-text">%1$s </span>%2$s</span>', | |
_x( 'Categories', 'Used before category names.', 'generatepress' ), | |
$categories_list | |
); | |
This file contains hidden or 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( 'generate_post_author_output','tu_append_edit_posts_link' ); | |
function tu_append_edit_posts_link( $output ) { | |
global $post; | |
if ( current_user_can( 'edit_post', $post->ID ) ) { | |
$url = get_edit_post_link(); | |
return $output . ' | <a href="' . esc_url( $url ) . '">Edit</a>'; | |
} else { | |
return $output; | |
} | |
} |
This file contains hidden or 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( 'generate_show_excerpt', 'tu_excerpt_image_format' ); | |
function tu_excerpt_image_format( $excerpt ) { | |
if ( 'image' == get_post_format() ) { | |
return true; | |
} | |
return $excerpt; | |
} |
This file contains hidden or 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( 'generate_typography_customize_list','tu_add_google_fonts' ); | |
function tu_add_google_fonts( $fonts ) { | |
$fonts[ 'alef' ] = array( 'name' => 'Alef' ); | |
return $fonts; | |
} |
This file contains hidden or 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( 'generate_sidebar_layout', 'tu_remove_sidebars' ); | |
function tu_remove_sidebars( $sidebar ) { | |
if ( is_404() ) { | |
return 'no-sidebar'; | |
} | |
return $sidebar; | |
} | |
add_filter( 'generate_footer_widgets', 'tu_remove_footer_widgets' ); |