Skip to content

Instantly share code, notes, and snippets.

View iamkingsleyf's full-sized avatar

Kingsley Felix iamkingsleyf

View GitHub Profile
@iamkingsleyf
iamkingsleyf / emebed gists in wordpress
Created April 13, 2014 19:47
Add to your functions.php
/**
* Embed Gists with a URL
*
* Usage:
* Paste a gist link into a blog post or page and it will be embedded eg:
* https://gist.github.com/2926827
*
* If a gist has multiple files you can select one using a url in the following format:
* https://gist.github.com/2926827?file=embed-gist.php
*/
@iamkingsleyf
iamkingsleyf / Pinterest pin it.js
Last active August 29, 2015 13:59
Add this script in your <head> section
<script type="text/javascript">
(function(d){
var f = d.getElementsByTagName('SCRIPT')[0], p = d.createElement('SCRIPT');
p.type = 'text/javascript';
p.setAttribute('data-pin-hover', true);
p.async = true;
p.src = '//assets.pinterest.com/js/pinit.js';
f.parentNode.insertBefore(p, f);
}(document));
</script>
/* Custom Content Styling
--------------------------------------------- */
.featured-content.featured-post-3 .featuredpost {
border: 1px solid #DDDDDD;
box-shadow: 0 0 10px #DDDDDD;
color: #54636E;
font-size: 16px;
-webkit-border-radius: 36px 12px;
-moz-border-radius: 36px / 12px;
border-radius: 36px / 12px;
@iamkingsleyf
iamkingsleyf / functions.php
Last active August 29, 2015 14:01
agency-pro breadcrumbs
//* Reposition breadcrumbs from before .entry to inside .entry (above title) on single Posts and static Pages
add_action( 'genesis_before_content', 'sk_reposition_breadcrumbs' );
function sk_reposition_breadcrumbs() {
if ( is_singular() ) {
remove_action( 'genesis_before_loop', 'genesis_do_breadcrumbs' );
add_action( 'genesis_entry_header', 'genesis_do_breadcrumbs', 9 );
}
/* Reposition breadcrumbs
--------------------------------------------- */
.single-post .breadcrumb, .page .breadcrumb {
color: #666;
}
.single-post .breadcrumb a, .page .breadcrumb a {
color: #D7C603;
}
@iamkingsleyf
iamkingsleyf / functions.php
Created May 8, 2014 23:21
Remove Genesis post meta
//* Remove the post meta function
remove_action( 'genesis_after_post_content', 'genesis_post_meta' );
@iamkingsleyf
iamkingsleyf / functions.php
Created May 8, 2014 23:26
Remove Genesis post meta from the homepage only
//* Remove entry meta in entry footer
add_action( 'genesis_before_entry', 'magazine_remove_entry_meta' );
function magazine_remove_entry_meta() {
//* Remove if not single post
if ( ! is_single() ) {
remove_action( 'genesis_entry_footer', 'genesis_entry_footer_markup_open', 5 );
remove_action( 'genesis_entry_footer', 'genesis_post_meta' );
remove_action( 'genesis_entry_footer', 'genesis_entry_footer_markup_close', 15 );
}
@iamkingsleyf
iamkingsleyf / function.php
Created May 8, 2014 23:29
Show genesis category meta on homepage
//* Customize the post meta function
add_filter( 'genesis_post_meta', 'sp_post_meta_filter' );
function sp_post_meta_filter($post_meta) {
if ( !is_page() ) {
$post_meta = '[post_categories before="Filed Under: "]';
return $post_meta;
}}
@iamkingsleyf
iamkingsleyf / contactform.php
Created May 11, 2014 11:41
Contact on wordpress without plugin
<?php
/*
Template Name: Contact Us
*/
//response generation function
$response = "";
//function to generate response
<?php
// register the custom post type widget area
genesis_register_sidebar( array(
'id' => 'cpt-archive-sidebar',
'name' => __( 'Custom Post Type Sidebar' ),
'description' => __( 'Display this sidebar on your custom post type archive page.' ),
) );