View gist:35c505f1aac124edf071f9008061ee6d
<script> | |
var slideoutLinks = document.querySelectorAll( '.slideout-navigation ul a' ); | |
for ( var i = 0; i < slideoutLinks.length; i++ ) { | |
slideoutLinks[i].removeEventListener( 'click', closeOffsideOnAction, false ); | |
}; | |
</script> |
View gist:8379abe390179c9fe828f2d6aa068eef
function generateblocks_get_parsed_content( $content = '' ) { | |
if ( ! function_exists( 'has_blocks' ) ) { | |
return; | |
} | |
if ( ! $content && has_blocks( get_the_ID() ) ) { | |
global $post; | |
if ( ! is_object( $post ) ) { | |
return; |
View gist:0d423140a25713facb6cc4db94e38ca6
add_filter( 'generate_premium_url_args', function( $args ) { | |
$args['ref'] = 123; // Add your affiliate ID | |
return $args; | |
} ); |
View gist:565683b10cca65050d7fb3a006efbc29
add_filter( 'generate_navigation_search_output', function() { | |
printf( | |
'<form method="get" class="search-form navigation-search" action="%1$s"> | |
<input type="search" class="search-field" value="%2$s" name="s" title="%3$s" /> | |
<input type="submit" class="search-button" value=""> | |
</form>', | |
esc_url( home_url( '/' ) ), | |
esc_attr( get_search_query() ), | |
esc_attr_x( 'Search', 'label', 'generatepress' ) | |
); |
View gist:2bb2667c9413e29579288687add966de
add_filter( 'generate_typography_default_fonts', function( $fonts ) { | |
if ( ! class_exists( 'Bsf_Custom_Fonts_Taxonomy' ) ) { | |
return $fonts; | |
} | |
$all_fonts = Bsf_Custom_Fonts_Taxonomy::get_fonts(); | |
if ( ! empty( $all_fonts ) ) { | |
foreach ( $all_fonts as $font_family_name => $fonts_url ) { | |
$fonts[] = $font_family_name; |
View comments.php
<?php | |
/** | |
* The template for displaying Comments. | |
* | |
* The area of the page that contains both current comments | |
* and the comment form. The actual display of comments is | |
* handled by a callback to generate_comment() which is | |
* located in the inc/template-tags.php file. | |
* | |
* @package GeneratePress |
View gist:64ee0304f3fd166f02df341fc9cc0968
add_filter( 'generate_search_button', function() { | |
return ''; | |
} ); |
View gist:179434f97888af190ee1d65e36402962
<div id="post-nav"> | |
<?php global $post; | |
$prevPost = get_previous_post(false); | |
$post_type = get_post_type(); | |
if($prevPost) { | |
$args = array( | |
'posts_per_page' => 1, | |
'include' => $prevPost->ID, | |
'post_type' => $post_type, |
View gist:bb5b5b84350f725ba3deaf5ee126c4cc
add_filter( 'generate_logo_href', function( $url ) { | |
if ( function_exists( 'pll_home_url' ) ) { | |
return pll_home_url(); | |
} | |
return $url; | |
} ); |
View gist:4f76e08e7198841bef15f9347afe7454
function generate_elements_ignore_languages( $post_id ) { | |
if ( function_exists( 'pll_get_post_language' ) && function_exists( 'pll_current_language' ) ) { | |
$language = pll_get_post_language( $post_id, 'locale' ); | |
if ( $language && $language !== pll_current_language( 'locale' ) ) { | |
return false; | |
} | |
} | |
return $post_id; |
NewerOlder