Skip to content

Instantly share code, notes, and snippets.

@samonja
samonja / add-author.css
Created June 28, 2017 13:13
Add an Author Info Box in WordPress Posts CSS
.author_bio_section{
background: none repeat scroll 0 0 #F5F5F5;
padding: 15px;
border: 1px solid #ccc;
}
.author_name{
font-size:16px;
font-weight: bold;
}
@samonja
samonja / author-box.php
Created June 28, 2017 13:01
Add an Author Info Box in WordPress Posts
function sm_author_info_box( $content ) {
global $post;
// Detect if it is a single post with a post author
if ( is_single() && isset( $post->post_author ) ) {
// Get author's display name
$display_name = get_the_author_meta( 'display_name', $post->post_author );
@samonja
samonja / generate-breadcrumbs.php
Created June 26, 2017 22:27
Generate breadcrumbs
/**
* Generate breadcrumbs
* @author CodexWorld
* @authorURL www.codexworld.com
*/
function get_breadcrumb() {
echo '<a href="/blog/" rel="nofollow">Blog</a>';
if (is_category() || is_single()) {
echo "&nbsp;&nbsp;&#187;&nbsp;&nbsp;";
the_category(' &bull; ');
@samonja
samonja / custom-dashboard-logo.php
Last active June 26, 2017 22:08
Add a Custom Dashboard Logo
function sm_custom_logo() {
echo '
<style type="text/css">
#wpadminbar #wp-admin-bar-wp-logo > .ab-item .ab-icon:before {
background-image: url(' . get_bloginfo('stylesheet_directory') . '/images/custom-logo.png) !important;
background-position: 0 0;
color:rgba(0, 0, 0, 0);
}
#wpadminbar #wp-admin-bar-wp-logo.hover > .ab-item .ab-icon {
background-position: 0 0;
function basic_wp_seo() {
global $page, $paged, $post;
$default_keywords = 'auto broker, auto, used car sale, honda, toyota, bmw, nissan, atlanta'; // customize
$output = '';
// description
$seo_desc = get_post_meta($post->ID, 'mm_seo_desc', true);
$description = get_bloginfo('description', 'display');
$pagedata = get_post($post->ID);
if (is_singular()) {