View sidebar.php
<?php
/**
* The Sidebar containing the main widget areas.
*
* @package GeneratePress
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}
View gist:8b1bb2d303ec2a8cc73fb382fd3656a6
add_filter( 'generate_post_author_output', 'tu_add_tags_to_author' );
add_filter( 'generate_show_categories', '__return_false' );
add_filter( 'generate_show_tags', '__return_false' );
function tu_add_tags_to_author( $output ) {
$tags_list = get_the_tag_list( '', _x( ', ', 'Used between list items, there is a space after the comma.', 'generatepress' ) );
$tags = '';
if ( $tags_list ) {
$tags = sprintf( '<span class="tags-links"><span class="screen-reader-text">%1$s </span>%2$s</span>',
_x( 'Tags', 'Used before tag names.', 'generatepress' ),
View gist:38a3d4d0e3f1be118cac76937e4c92e6
add_action( 'after_setup_theme', 'tu_move_nav_search' );
function tu_move_nav_search() {
remove_action( 'generate_inside_navigation', 'generate_navigation_search' );
add_action( 'generate_inside_secondary_navigation', 'generate_navigation_search' );
remove_filter( 'wp_nav_menu_items', 'generate_menu_search_icon', 10, 2 );
}
add_filter( 'wp_nav_menu_items', 'tu_secondary_menu_search_icon', 10, 2 );
function tu_secondary_menu_search_icon( $nav, $args ) {
$generate_settings = wp_parse_args(
View gist:803a950d6381dd98e6bc4418b817ed82
if ( ! function_exists( 'generate_content_nav' ) ) {
/**
* Display navigation to next/previous pages when applicable.
*
* @since 0.1
*
* @param string $nav_id The id of our navigation.
*/
function generate_content_nav( $nav_id ) {
if ( ! apply_filters( 'generate_show_post_navigation', true ) ) {
View gist:a6d9d71218832f0f0260885f9f5acd4f
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' );
}
}
View gist:c0fbec9e017e6f148d8d644be90a6fed
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;
}
View gist:d25cdc125c7950bffc7223daaeea3065
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 );
View gist:cdb67600504b71169c285c9d1788d5d7
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
}
View gist:8bc94ae43f67c40a077aefc8ec970fd0
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' ) ),
View gist:b3c574437f49c1fd26f4d6e9a3a6af55
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
);