Skip to content

Instantly share code, notes, and snippets.

🏠
Working from home

Sodbileg Gansukh minimaluminium

Block or report user

Report or block minimaluminium

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View puffin-chris.php
function puffin_entry_footer() {
if ( ! is_single() ) {
global $post;
if ( strpos( $post->post_content, '<!--more-->' ) ) {
echo '<a class="read-more" href="' . esc_url( get_the_permalink() ) . '">' . esc_html( apply_filters( 'puffin_readmore_button_text', esc_html__( 'Read More', 'puffin' ) ) ) . '</a>';
}
}
$time_string = '<time datetime="%1$s">%2$s</time>';
@minimaluminium
minimaluminium / example-slider
Last active Sep 15, 2015 — forked from tommusrhodus/example-slider
This is a much more complex block, both the wrapper and nested shortcodes have options applied to them, furthermore they require globals to collect additional data and render it outside of the $content.
View example-slider
<?php
global $slider_pro_thumbs;
/**
* The Shortcode
*/
function ebor_slider_pro_shortcode( $atts, $content = null ) {
global $slider_pro_thumbs;
$slider_pro_thumbs = false;
@minimaluminium
minimaluminium / example-skills-block
Last active Sep 15, 2015 — forked from tommusrhodus/example-skills-block
This example is just really simple, the main shortcode is simple enough to not need any options or globals applied, it simply wraps the innner shortcodes.
View example-skills-block
<?php
/**
* The Shortcode
*/
function ebor_skills_shortcode( $atts, $content = null ) {
$output = '<div class="skills-wrapper">'. do_shortcode($content) .'</div>';
return $output;
}
add_shortcode( 'machine_skills', 'ebor_skills_shortcode' );
@minimaluminium
minimaluminium / gist:d6573a9cfab0dfb15621
Created Feb 28, 2015
Support different post formats on posts and custom post types in WordPress
View gist:d6573a9cfab0dfb15621
add_theme_support( 'post-formats', array( 'gallery', 'link', 'quote', 'audio', 'video' ) );
add_post_type_support( 'cpt_portfolio', 'post-formats' );
function adjust_post_formats() {
if ( isset( $_GET['post'] ) ) {
$post = get_post( $_GET['post'] );
if ( $post ) {
$post_type = $post->post_type;
}
You can’t perform that action at this time.