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() {
printf( '<span class="posted-on">Published on %1$s at %2$s %3$s</span>',
esc_html( get_the_date() ),
esc_attr( get_the_time() ),
get_the_time( 'U' ) !== get_the_modified_time( 'U' ) ? '| Updated on ' . esc_html( get_the_modified_date() ) . ' at ' . get_the_modified_time() : ''
);
}
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
);
View gist:4a6ec717cdb740066b1a1cfb59e9bccb
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;
}
}
View gist:ca10c4de1a66615d8cdc9b3ad021f95b
add_filter( 'generate_show_excerpt', 'tu_excerpt_image_format' );
function tu_excerpt_image_format( $excerpt ) {
if ( 'image' == get_post_format() ) {
return true;
}
return $excerpt;
}
View gist:70a67d226b9954cc4945ada391ba215b
add_filter( 'generate_typography_customize_list','tu_add_google_fonts' );
function tu_add_google_fonts( $fonts ) {
$fonts[ 'alef' ] = array( 'name' => 'Alef' );
return $fonts;
}
View gist:687f18772343314b05828725253db342
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' );
View gist:b66e008efdf664c1ca9a9e24d36e2feb
[lgc_column grid="33" tablet_grid="33" mobile_grid="100"]First column content in here[/lgc_column]
[lgc_column grid="33" tablet_grid="33" mobile_grid="100"]Second column content in here[/lgc_column]
[lgc_column grid="33" tablet_grid="33" mobile_grid="100" last="true"]Third column content in here[/lgc_column]
View gist:4b79c032a29e52f769eb3a1e7d41155f
add_action( 'wp', 'tu_disable_cpt_elements' );
function tu_disable_cpt_elements() {
if ( is_page() || 'product' == get_post_type() ) {
remove_action( 'generate_before_header', 'generate_top_bar', 5 );
remove_action( 'generate_header', 'generate_construct_header' );
add_filter( 'generate_show_title', '__return_false' );
}
}