Skip to content

Instantly share code, notes, and snippets.

@vijujohns
vijujohns / dashicon-include.html
Created July 25, 2015 19:13
Include dashicon
<i class="dashicons dashicons-wordpress"></i>
// Register a new custom post type named Books;
register_post_type('books', array(
'public' => true,
'menu_icon' => 'dashicons-book',
'label' => __( 'Books', 'local' ),
)
);
@vijujohns
vijujohns / dashicon-margin.css
Created July 20, 2015 04:28
Right margin for Dashicon
.dashicons {
margin-right:2px;
}
//Enqueue the Dashicons script
add_action( 'wp_enqueue_scripts', 'enable_dashicons_for_theme' );
function enable_dashicons_for_theme() {
wp_enqueue_style( 'dashicons' );
}
@vijujohns
vijujohns / include-related-posts-function.php
Last active August 29, 2015 14:25
Code to include related posts to function.php, so that related posts are shown at the end of each post http://www.wppicker.com/how-to-add-responsive-related-posts-without-plugin/
.wpp-mailchimp{
background-color:#333;
color:#999;
padding:20px;
border-radius:10px;
}
.wpp-mailchimp h2{
color:#fff;
text-align:center;
padding-bottom:10px;
<!-- Begin MailChimp Signup Form -->
<div id="mc_embed_signup" class="wpp-mailchimp">
<form action="xxxxxxxxxx" method="post" id="mc-embedded-subscribe-form" name="mc-embedded-subscribe-form" class="validate" target="_blank" novalidate>
<div id="mc_embed_signup_scroll">
<h2>Newsletter</h2>
<p>Enter your email address to subscribe to this blog and receive notifications of new posts by email</p>
<div class="mc-field-group">
<input type="email" value="" name="EMAIL" class="required email" id="mce-EMAIL" placeholder="Your Email Address">
</div>
<div class="mc-field-group">
/*add a custom image size, I'm calling it 'new-size'*/
//if ( function_exists( 'add_image_size' ) ) {
//add_image_size( 'new-size', 300, 100, true ); //(cropped)
//}
/*enable the 'new-size' in Insert Media Dialog*/
add_filter('image_size_names_choose', 'my_image_sizes');
function my_image_sizes($sizes) {
$addsizes = array(
"new-size" => __( "New Size")