Skip to content

Instantly share code, notes, and snippets.

View puikinsh's full-sized avatar
☘️

Aigars Silkalns puikinsh

☘️
View GitHub Profile
<?php
// Shortcode to display a subscription message on your website
function subscribe_link_shortcode() {
return 'Did you like what you read? Now, let all these posts be delivered right into your inbox. Simply <a href="http://feeds.feedburner.com/Myblog" title="Subscribe to the Site">subscribe to My Blog Posts via RSS</a>.';
}
add_shortcode('subscribe', 'subscribe_link_shortcode');
?>
@puikinsh
puikinsh / gist:133770bfe41e9a57c3fb
Last active August 29, 2015 14:10
WordPress shortcodes with attributes. Originally published on http://colorlib.com/wp/shortcodes-can-add-life-wordpress-themes/
<?php
// Enhanced subscription feature with attributes
function subscribe_multilink_shortcode( $atts ) {
extract( shortcode_atts( array(
'subtype' => 'RSS',
'subtypeurl' => 'http://feeds.feedburner.com/MyBlog',
), $atts, 'multilink' ) );
return sprtinf( 'Get our posts and latest updates delivered directly to your inbox<a href="%1$s">by %2$s</a>.',
esc_url( $subtypeurl ),
@puikinsh
puikinsh / gist:0f3117087130ddaaa397
Created December 6, 2014 21:09
Dazzling Custom settings for Flexslider. Answer to this thread: http://colorlib.com/wp/forums/topic/slider-speed/
jQuery(document).ready(function(){jQuery('#submit, .wpcf7-submit, .comment-reply-link, input[type="submit"]').addClass('btn btn-default');jQuery('.wp-caption').addClass('thumbnail');jQuery('.widget_rss ul').addClass('media-list');jQuery('table#wp-calendar').addClass('table table-striped')});jQuery(document).ready(function(){jQuery(window).scroll(function(){if(jQuery(this).scrollTop()>100){jQuery('.scroll-to-top').fadeIn()}else{jQuery('.scroll-to-top').fadeOut()}});jQuery('.scroll-to-top').click(function(){jQuery('html, body').animate({scrollTop:0},800);return false})});(function(){var is_webkit=navigator.userAgent.toLowerCase().indexOf('webkit')>-1,is_opera=navigator.userAgent.toLowerCase().indexOf('opera')>-1,is_ie=navigator.userAgent.toLowerCase().indexOf('msie')>-1;if((is_webkit||is_opera||is_ie)&&document.getElementById&&window.addEventListener){window.addEventListener('hashchange',function(){var element=document.getElementById(location.hash.substring(1));if(element){if(!/^(?:a|select|input|button|textare
@puikinsh
puikinsh / gist:14cba3c371580cf64e93
Created December 19, 2014 10:11
Remove border around posts in Pinbin theme
.type-post, .type-page, .type-attachment, #post-area .post {
border: none;
}
@puikinsh
puikinsh / gist:4bb8423af559800f53c5
Created April 18, 2015 16:11
Function improvement for travelify theme
if ( ! function_exists( 'travelify_posted_on' ) ) :
/**
* Prints HTML with meta information for the current post-date/time and author.
*/
function travelify_posted_on() {
$time_string = '<time class="entry-date published updated" datetime="%1$s">%2$s</time>';
if ( get_the_time( 'U' ) !== get_the_modified_time( 'U' ) ) {
$time_string = '<time class="entry-date published" datetime="%1$s">%2$s</time><time class="updated" datetime="%3$s">%4$s</time>';
}
$time_string = sprintf( $time_string,
@puikinsh
puikinsh / gist:5a6c564e16927109b81e
Created June 26, 2015 08:08
None clickable slider for Dazzling theme
if ( ! function_exists( 'dazzling_featured_slider' ) ) :
/**
* Featured image slider
*/
function dazzling_featured_slider() {
if ( is_front_page() && of_get_option('dazzling_slider_checkbox') == 1 ) {
echo '<div class="flexslider">';
echo '<ul class="slides">';
$count = of_get_option('dazzling_slide_number');
<!DOCTYPE html>
<!--[if IE 7]>
<html class="ie ie7" <?php language_attributes(); ?>>
<![endif]-->
<!--[if IE 8]>
@puikinsh
puikinsh / gist:d4107e83cf140c4dd3df
Created July 1, 2015 13:32
page-lp-example.php content. This is code snippet is part of tutorial you can find here: https://colorlib.com/wp/creating-a-perfect-wordpress-landing-page
<?php
/* Template Name: LP Example */
get_header('lp-example'); ?>
<div id="main-content" class="main-content">
<div id="primary" class="content-area">
</div><!– #main –>
<footer id=”colophon” class=”site-footer” role=”contentinfo”>
<div class=”site-info”>
</div><!– .site-info –>
</footer><!– #colophon –>
<?php
/**
* Template Name: Landing Page
*/
?>