View archive-{post_type}.php
<?php
/**
* The template for displaying Archive pages.
*
* @package GeneratePress
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}
View gist:9f99bbfa532ea4f9eafb6bd238b8cc9a
.main-navigation .site-branding {
float: left;
}
.main-navigation .site-branding a {
line-height: 60px;
font-size: 20px;
}
View gist:e41f0e0d083b4c2350ac772eb69479f1
add_action( 'after_setup_theme', 'tu_navigation_as_header' );
function tu_navigation_as_header() {
remove_action( 'generate_header', 'generate_construct_header' );
add_action( 'generate_inside_navigation', 'tu_site_title_navigation' );
}
function tu_site_title_navigation() {
?>
<div class="site-branding">
<p class="main-title" itemprop="headline">
View gist:2d037a5a7341ffc67c6af1a056b54e34
add_action( 'admin_init', 'tu_remove_google_fonts' );
function tu_remove_google_fonts() {
add_filter( 'generate_google_fonts_array', '__return_false' );
}
View gist:38a00e43abb9a758c14a5e07ffbee0b3
add_action( 'wp', 'tu_add_page_header_image_woocommerce', 60 );
function tu_add_page_header_image_woocommerce() {
if ( function_exists( 'is_woocommerce' ) && is_woocommerce() ) {
add_action( 'generate_before_content', 'generate_page_header' );
}
}
View gist:589b9e91bca7205883b0454f15a4dcf9
<script>
var hamburger = document.querySelector(".hamburger"),
menuToggle = document.querySelector( '.menu-toggle' ),
menuItems = document.querySelectorAll( 'nav ul a' );
menuToggle.addEventListener("click", function() {
hamburger.classList.toggle("is-active");
} );
for ( var i = 0; i < menuItems.length; i++ ) {
View gist:ebe343298b30bbec84947b940c7526f0
<?php
/**
* The template for displaying posts within the loop.
*
* @package GeneratePress
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}
View gist:e125229c3884b769c25b5546d8dd735e
add_filter( 'generate_dashboard_page_capability', 'tu_super_admin_dashboard' );
function tu_super_admin_dashboard() {
return 'manage_sites';
}
View gist:57610006a85c206fea53131986022a91
function generatepress_wc_secondary_product_image() {
$post_type = get_post_type( get_the_ID() );
if ( 'product' == $post_type && method_exists( 'WC_Product', 'get_gallery_image_ids' ) ) {
$product = new WC_Product( get_the_ID() );
$attachment_ids = $product->get_gallery_image_ids();
if ( $attachment_ids && generatepress_wc_get_setting( 'product_secondary_image' ) && generatepress_wc_get_setting( 'product_archive_image' ) && has_post_thumbnail() ) {
$secondary_image_id = $attachment_ids['0'];
echo wp_get_attachment_image( $secondary_image_id, 'shop_catalog', '', $attr = array( 'class' => 'secondary-image attachment-shop-catalog' ) );
View gist:92ebb34e67ce6f538fdb457137f7a9b4
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' );
add_filter( 'generate_show_comments', '__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
);