Skip to content

Instantly share code, notes, and snippets.

View mikemcalister's full-sized avatar

Mike McAlister mikemcalister

View GitHub Profile
/*
* Change multiple Infinite Scroll settings
*/
function theme_infinite_scroll_settings( $args ) {
if ( is_array( $args ) )
$args['type'] = 'click';
$args['posts_per_page'] = 20;
return $args;
}
add_filter( 'infinite_scroll_settings', 'theme_infinite_scroll_settings' );
/*
* Change the Infinite Scroll button text
*/
function theme_infinite_scroll_button_text( $js_settings ) {
$js_settings['text'] = esc_html__( 'Load more', 'theme' );
return $js_settings;
}
add_filter( 'infinite_scroll_js_settings', 'theme_infinite_scroll_button_text' );
/**
* Unhook the cart widget/icon
*
*/
function checkout_remove_cart_icon() {
remove_filter( 'wp_nav_menu_items', 'checkout_add_cart_widget_to_menu', 10, 2 );
add_filter( 'wp_nav_menu_items', 'whatever_his_shit_is', 1, 2 );
}
add_action( 'init', 'checkout_remove_cart_icon' );
/**
* Unhook the cart widget/icon
*
*/
function checkout_remove_cart_icon() {
remove_filter( 'wp_nav_menu_items', 'checkout_add_cart_widget_to_menu', 10, 2 );
add_filter( 'wp_nav_menu_items', 'checkout_add_revised_cart_widget_to_menu', 1, 2 );
}
add_action( 'init', 'checkout_remove_cart_icon' );
/**
* Unhook the cart widget/icon
*
*/
function checkout_remove_cart_icon() {
remove_filter( 'wp_nav_menu_items', 'checkout_add_cart_widget_to_menu', 10, 2 );
add_filter( 'wp_nav_menu_items', 'checkout_add_revised_cart_widget_to_menu', 1, 2 );
}
add_action( 'init', 'checkout_remove_cart_icon' );
<table>
<thead>
<tr>
<th>Beatle</th>
<th>Instrument</th>
<th>Song</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<?php
/**
* The template used for displaying hero posts in the header
*
* @package Paperback
*/
$image_class = has_post_thumbnail() ? 'with-featured-image hero-post' : 'without-featured-image hero-post';
?>
<div id="post-<?php the_ID(); ?>" <?php post_class( $image_class ); ?>>
<section class="pricing-section featured-price">
<div class="pricing-table-wrap">
<div itemscope="" class="pricing-table" style="opacity: 1;">
<div class="pricing-table-top">
<div class="pricing-table-price">$5.00</div>
<div class="pricing-table-price-desc">One Month Access</div>
</div>
<div class="pricing-table-features">
<div class="contact-column">
Creating a contact page is quick and easy. Simply enable the Jetpack Contact Form feature, and use the Add Contact Form button on any post or page you’d like. Lenscap provides elegant, mobile-friendly styles for all forms and inputs. Although the demo uses Jetpack for a quick contact form, you can use any contact form plugin you'd like, Lenscap provides beautiful generic styles that will work with any plugin.
[contact-form][contact-field label='Name' type='name' required='1'/][contact-field label='Email' type='email' required='1'/][contact-field label='Website' type='url'/][contact-field label='Comment' type='textarea' required='1'/][/contact-form]
</div>
<div class="contact-column">
<iframe style="border: 0;" src="https://www.google.com/maps/embed?pb=!1m14!1m8!1m3!1d13883.34839184614!2d-95.096958!3d29.550238!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x0%3A0x13f0aac92fd5f916!2sSpace+Center+Houston!5e0!3m2!1sen!2sus!4v1471923265702" width="100%" height="450" frameborder="0" allowfulls
<div class="container">
<h3>Featured Products</h3>
[featured_products per_page="4"]
</div>
<div class="container">
<h3>Newest Products</h3>
[recent_products per_page="4"]
</div>