Skip to content

Instantly share code, notes, and snippets.

View surefirewebserv's full-sized avatar

Jonathan Perez surefirewebserv

View GitHub Profile
<?php
add_filter( 'genesis_attr_nav-secondary', 'gsbb_menu_second_align_left', 10, 2 );
function gsbb_menu_second_align_left( $attributes, $gs_class ) {
if ($gs_secondary_alignment == 'menu_sencond_align_left'){
$gs_class = "nav-left";
} else if ($gs_secondary_alignment == 'menu_second_align_right') {
@surefirewebserv
surefirewebserv / clean.html
Created December 13, 2016 15:30
Clean Grid for Views
[wpv-layout-start]
[wpv-items-found]
<!-- wpv-loop-start -->
<wpv-loop wrap="3" pad="true">
[wpv-item index=1]
<div class="first one-third">
<h2>[wpv-taxonomy-title]</h2>
[wpv-view name="List of Lessons in Course"]
</div>
[wpv-item index=other]
@surefirewebserv
surefirewebserv / mess.html
Created December 13, 2016 15:27
Here's the mess that views outputs
[wpv-layout-start]
[wpv-items-found]
<!-- wpv-loop-start -->
<table width="100%" class="wpv-loop js-wpv-loop">
<wpv-loop wrap="3" pad="true">
[wpv-item index=1]
<tr>
<td>
<h2>[wpv-taxonomy-title]</h2>
[wpv-view name="List of Lessons in Course"]
<script>
var $ = jQuery;
$(document).ready( function() {
$('.shows select').change(function(){
var name = $(this).parent().parent().attr('class').split(' ');
var row = name[3];
var mainClass = row.split('--');
var values = $(this).val().split(' -- '); //Event-Date-Location
$('.location-' + mainClass[1] + ' input').val(values[2]);
$('.venue-date-' + mainClass[1] + ' input').val(values[1]);
@surefirewebserv
surefirewebserv / gist:6c2d511236ab75976dcd
Created February 20, 2016 03:35
Simple Toggle jQuery
jQuery(document).ready(function(){
jQuery(".toggle-script").click(function (e) {
e.preventDefault();
jQuery("#toggle-show-more").toggle("blind");
});
});
@surefirewebserv
surefirewebserv / hide-categories.php
Created October 26, 2015 15:26
Hide Categories from WP Category Widget
<?php
/* Remove category from category widget */
function dtwd_exclude_widget_category($args){
$exclude = "1,2,3"; // IDs of excluding categories
$args["exclude"] = $exclude;
return $args;
}
add_filter("widget_categories_args","dtwd_exclude_widget_category");
@surefirewebserv
surefirewebserv / p2p_setup.php
Created October 2, 2015 17:58
Sample Set Up with Multiple Relationships
<?php
// Don't copy the php tag above.
function sfws_books_to_relationship() {
p2p_register_connection_type( array(
'name' => 'bookes_to_authors', //Give it a name that you can reference
'from' => 'books', // This can be the slug name of your CPT as well
'to' => 'authors' // This can be the slug name of your CPT as well
) );
p2p_register_connection_type( array(
@surefirewebserv
surefirewebserv / display_p2p.php
Last active August 29, 2015 14:26
Add this to functions.php
<?php //Don't Copy This Line
//Add to single product page.
add_action( 'woocommerce_single_product_summary', 'return_policy', 999 );
function return_policy() {
// Find connected pages
$connected = new WP_Query( array(
'connected_type' => 'posts_to_pages', // Use same name as you used in the previous function.
'connected_items' => get_queried_object(),
'nopaging' => true,
$('.trigger-click').click(function() {
$( '.et_bloom_popup' ).each( function() {
auto_popup( $( this ), 0 );
});
});
@surefirewebserv
surefirewebserv / form.html
Created April 15, 2015 15:30
Make sure all your quotes are double quotes and not single. Also, you need to keep the paragraph tags and the classes with each one.
<form action="your_action_url" method="post">
<p class="et_bloom_popup_input et_bloom_subscribe_name"> <!-- keep note of the paragraph and the classes being used, you need this -->
<input type="text" id="input_1" name="q1_control_fname" size="50" placeholder="Name" /> <!-- Placeholder is important -->
</p>
<p class="et_bloom_popup_input et_bloom_subscribe_email">
<input type="email" class="validate[required, Email]" id="input_4" name="q4_email" size="50" placeholder="Email Address" />
</p>
<button id="input_2" type="submit" class="form-submit-button">Learn How!</button>
</form>