Skip to content

Instantly share code, notes, and snippets.

View wplogout's full-sized avatar
🏠
Working from home

wplogout

🏠
Working from home
View GitHub Profile
add_filter( 'wp_trim_excerpt', 'tu_excerpt_metabox_more' );
function tu_excerpt_metabox_more( $excerpt ) {
$output = $excerpt;
if ( has_excerpt() ) {
$output = sprintf( '%1$s <p class="read-more-button-container"><a class="read-more button" href="%2$s">%3$s</a></p>',
$excerpt,
get_permalink(),
__( 'Read more →', 'generatepress' )
);
<div id="wplogout-top-bar-notification">
<div class="notice-inner grid-container">INSERT YOUR NOTIFICATION HERE! <a href="ENTER YOUR URL HERE" target="_blank"><button>INSERT YOUR LINK Text HERE
</button></a>
</div>
</div>
<a class="yourclassname" href="mailto:?subject=<?php echo wp_title(''); ?>&amp;body=<?php echo $wplogoutURL; ?>" target="_blank" rel="nofollow"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M12 12.713l-11.985-9.713h23.971l-11.986 9.713zm-5.425-1.822l-6.575-5.329v12.501l6.575-7.172zm10.85 0l6.575 7.172v-12.501l-6.575 5.329zm-1.557 1.261l-3.868 3.135-3.868-3.135-8.11 8.848h23.956l-8.11-8.848z"/></svg></a>
@wplogout
wplogout / related post by tags and category in Generatepress.php
Created May 11, 2020 17:13
related post by tags and category in Generatepress
<div class="wpsp-related-posts grid-container">
<h2>Related Posts</h2>
<?php
if ( is_single() ) {
$tags = get_the_tags();
$tags_list = [];
foreach ($tags as $tag)
$tags_list[] = $tag->slug;
$tag_string = implode( ', ', $tags_list);
} else {