Skip to content

Instantly share code, notes, and snippets.

View braginteractive's full-sized avatar

Brad Williams braginteractive

View GitHub Profile
@braginteractive
braginteractive / hero-contact7.html
Created February 20, 2018 18:19
LeadGenWP - Hero Contact Form Markup
<div class="card">
<div class="card-header">
Request a free quote for your project
</div>
<div class="card-body">
<div class="row">
<div class="form-group col-md-6">
<label for="firstname">First name</label>[text* first-name id:firstname class:form-control]
</div>
<div class="form-group col-md-6">
<i class="fas fa-comments"></i> Free Estimate
@braginteractive
braginteractive / logo-size.css
Created January 22, 2018 22:20
Additional CSS Logo Customization
.logo a img {
max-width: 250px;
}
@braginteractive
braginteractive / posts-pagination.php
Created December 22, 2017 19:08
Font Awesome Posts Pagination for WordPress
the_posts_pagination (
array(
'prev_text' => '<i class="fa fa-arrow-left" aria-hidden="true"></i><span class="screen-reader-text">' . __( 'Previous Page', 'textdomain' ) . '</span>',
'next_text' => '<span class="screen-reader-text">' . __( 'Next Page', 'textdomain' ) . '</span><i class="fa fa-arrow-right" aria-hidden="true"></i>',
)
);
@braginteractive
braginteractive / wordpress-excerpt-function.php
Created December 22, 2017 18:56
Edit the WordPress excerpt to remove everything after the first sentence.
/**
* Find the first period in the excerpt and remove everything after it.
*
*
* @param string $excerpt The post excerpt.
*/
function end_with_sentence($excerpt) {
return substr($excerpt,0,strpos($excerpt,'.')+1);
}
add_filter( 'the_excerpt', 'end_with_sentence');
@braginteractive
braginteractive / customizer.php
Created December 13, 2017 19:43
Add Bootswatch to StrapPress
if ( class_exists('Kirki') ) {
Kirki::add_config( 'strappress_theme', array(
'capability' => 'edit_theme_options',
'option_type' => 'theme_mod',
) );
/* Add Bootswatch to Colors Section */
Kirki::add_field( 'strappress_theme', array(
'type' => 'radio-image',
'settings' => 'bootswatch_css',
@braginteractive
braginteractive / echo-post-meta.php
Created June 1, 2017 19:24
Echo all Post Meta Data
<?php
$myvals = get_post_meta(get_the_ID());
foreach($myvals as $key=>$val)
{
echo $key . ' : ' . $val[0] . '<br/>';
}
?>
@braginteractive
braginteractive / customizer.php
Last active May 12, 2017 16:09
Hero Banner settings for WordPress Customizer
<?php
if ( class_exists( 'Kirki' ) ) {
/**
* Add the theme configuration
*/
Kirki::add_config( 'strappress_theme', array(
'option_type' => 'theme_mod',
'capability' => 'edit_theme_options',
) );
@braginteractive
braginteractive / customizer.php
Last active May 12, 2017 15:59
Kirki code to add Typography to WordPress theme
<?php
/**
* StrapPress Theme Customizer
*
* @package StrapPress
*/
/**
* Add postMessage support for site title and description for the Theme Customizer.
*
@braginteractive
braginteractive / footer.php
Created May 10, 2017 18:44
Footer with 3 widget areas