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_dashboard_page_capability', 'tu_super_admin_dashboard' ); | |
function tu_super_admin_dashboard() { | |
return 'manage_sites'; | |
} |
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
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' ) ); |
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' ); | |
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 | |
); |
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', function() { | |
add_filter( 'body_class', function( $classes ) { | |
if ( function_exists( 'elementor_location_exits' ) && elementor_location_exits( 'archive', true ) ) { | |
$classes[] = 'full-width-content'; | |
} | |
return $classes; | |
} ); | |
} ); |
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
function tu_lifterlms_start() { ?> | |
<div id="primary" <?php generate_content_class();?>> | |
<main id="main" <?php generate_main_class(); ?>> | |
<?php do_action('generate_before_main_content'); ?> | |
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?> <?php generate_article_schema( 'CreativeWork' ); ?>> | |
<div class="inside-article"> | |
<?php do_action( 'generate_before_content'); ?> | |
<div class="entry-content" itemprop="text"> | |
<?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_action( 'generate_before_header', 'tu_add_gtm_code', 0 ); | |
function tu_add_gtm_code() { | |
if ( function_exists( 'gtm4wp_the_gtm_tag' ) ) { | |
gtm4wp_the_gtm_tag(); | |
} | |
} |
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_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' ), |
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( 'after_setup_theme', function() { | |
remove_action( 'generate_inside_navigation', 'generate_navigation_search' ); | |
remove_action( 'generate_inside_navigation', 'generate_mobile_menu_search_icon' ); | |
add_action( 'generate_inside_secondary_navigation', 'generate_navigation_search' ); | |
add_action( 'generate_inside_secondary_navigation', 'generate_mobile_menu_search_icon' ); | |
remove_filter( 'wp_nav_menu_items', 'generate_menu_search_icon', 10, 2 ); | |
} ); |
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
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 ) ) { |