Skip to content

Instantly share code, notes, and snippets.

Vũ Đức Mạnh manhleo93

View GitHub Profile
View gist:6935bd5143aa5b06afcc1a88363f14c9
remove_action( 'genesis_after_entry', 'genesis_do_author_box_single', 8);
add_action('genesis_after_entry', 'theme_author_box', 8);
function theme_author_box() {
$authinfo = "<div class=\"postauthor\">\r\n";
$authinfo .= get_avatar(get_the_author_id() , 100);
$authinfo .= "<h4>". get_the_author_meta('display_name') ."</h4>\r\n";
$authinfo .= "<p>" . get_the_author_meta('description') . "</p>\r\n";
$authinfo .= "</div>\r\n";
$facebook = get_the_author_meta('facebook');
View gist:603ad2f1d6206482378b7c9fc0e27103
// show notice if license is invalid
if ( ! $this->license_is_valid() ) {
if ( $this->get_license_key() == '' ) {
$message = __( '<b>Warning!</b> You didn\'t set your %s license key yet, which means you\'re missing out on updates and support! <a href="%s">Enter your license key</a> or <a href="%s" target="_blank">get a license here</a>.' );
} else {
$message = __( '<b>Warning!</b> Your %s license is inactive which means you\'re missing out on updates and support! <a href="%s">Activate your license</a> or <a href="%s" target="_blank">get a license here</a>.' );
}
?>
<div class="notice notice-error yoast-notice-error">
<p><?php printf( __( $message, $this->product->get_text_domain() ), $this->product->get_item_name(), $this->product->get_license_page_url(), $this->product->get_tracking_url( 'activate-license-notice' ) ); ?></p>
View gist:e50f4ff48dd48aecc257e8b80dfa04c7
/* ## Comments by Vũ đức Mạnh
--------------------------------------------- */
.comment-respond,
.entry-pings,
.entry-comments {
color: #32373c;
padding: 20px 45px 40px 45px;
overflow: hidden;
background: #fff;
}
View functions.php
// Code to Display Featured Image with Caption on top of the post
add_action( 'genesis_before_entry', 'featured_post_image', 8 );
function featured_post_image() {
if ( ! is_singular( 'post' ) ) {
return;
}
$image = genesis_get_image( 'format=url&size=post-image' ); // get the URL of featured image.
View style.css
.wp-caption-text {
font-size: 18px;
font-size: 1.8rem;
font-weight: 700;
margin: 0;
text-align: left;
background: #fff;
border-bottom: 1px solid #ddd;
padding: 17px 0 17px 24px;
line-height: 120%;
View functions.php
// Load Font Awesome
add_action( 'wp_enqueue_scripts', 'enqueue_font_awesome' );
function enqueue_font_awesome() {
wp_enqueue_style( 'font-awesome', '//maxcdn.bootstrapcdn.com/font-awesome/latest/css/font-awesome.min.css' );
}
View functions.php
// Display Post Word Count in Genesis
// Note: Special Thanks to Victor Front: Ref: https://www.facebook.com/groups/genesiswp/permalink/1536463436404848/
// Print Post Word Count and Create a Shortcode
add_shortcode( 'word-count', 'post_word_count' );
function post_word_count() {
return sprintf( __( '%s Words', 'leaguewp' ), str_word_count( strip_tags( get_post_field( 'post_content', get_the_ID() ) ), 0 ) );
}
// Customize Post Info in Entry Header and Insert Short Code for Post Word Count
View style.css
.entry-comments-link::before, .entry-time::after {
content: "\2014";
margin: 0 6px 0 2px;
}
View gist:936cc3b3dd92b9894a6256cf8d343d01
/* Thêm cột vào Footer - Và thiết kế lại form eNews Extended trong genesis */
.footer-widgets-1 {
width: 100%;
}
.enews-widget input {
font-size: 17px;
margin-bottom: 12px;
width: 400px;
View functions.php
// Customize Lists in Recent Posts Widget
class Genesis_Widget_Recent_Posts extends WP_Widget {
function __construct() {
$widget_ops = array('classname' => 'widget_recent_entries', 'description' => __( "The most recent posts on your site") );
parent::__construct('recent-posts', __('Recent Posts'), $widget_ops);
$this->alt_option_name = 'widget_recent_entries';
add_action( 'save_post', array($this, 'flush_widget_cache') );
add_action( 'deleted_post', array($this, 'flush_widget_cache') );
You can’t perform that action at this time.