Skip to content

Instantly share code, notes, and snippets.

View puikinsh's full-sized avatar
☘️

Aigars Silkalns puikinsh

☘️
View GitHub Profile
@puikinsh
puikinsh / Add text in the right side of the footer in Travelify theme
Created October 12, 2013 08:40
Code snippet to be added in Travelify Child Theme functions.php file in order to display text in the right side of the footer.
@puikinsh
puikinsh / gist:7355544
Created November 7, 2013 14:35
Replace navigation directions for Pinbin WordPress theme
<div class="post-nav">
<div class="post-prev"><?php next_post_link('%link', '&larr;'); ?></div>
<div class="post-next"><?php previous_post_link('%link', '&rarr;'); ?></div>
</div>
<div class="pinbin-copy">
<?php } else { ?>
<div class="post-nav">
<div class="post-prev"><?php next_post_link('%link', '&larr;'); ?></div>
<div class="post-next"><?php previous_post_link('%link', '&rarr;'); ?></div>
</div>
@puikinsh
puikinsh / gist:8255132
Created January 4, 2014 13:00
Some style modifications for sbchart.se/wp
#site-logo {
margin-top: 0;
}
.hgroup-wrap {
padding-top: 0;
}
#branding {
margin-top: 0;
}
#footerarea {
@puikinsh
puikinsh / gist:8420137
Created January 14, 2014 15:30
Add thumbnails to single post view in Travelify theme
<?php
if( has_post_thumbnail() ) {
$image = '';
$title_attribute = apply_filters( 'the_title', get_the_title( $post->ID ) );
$image .= '<figure class="post-featured-image">';
$image .= '<a href="' . get_permalink() . '" title="'.the_title( '', '', false ).'">';
$image .= get_the_post_thumbnail( $post->ID, 'featured', array( 'title' => esc_attr( $title_attribute ), 'alt' => esc_attr( $title_attribute ) ) ).'</a>';
$image .= '</figure>';
echo $image;
@puikinsh
puikinsh / gist:9173749
Created February 23, 2014 16:37
Travelify footer copyright info without WordPress link
add_action( 'travelify_footer', 'travelify_footer_info', 30 );
/**
* function to show the footer info, copyright information
*/
function travelify_footer_info() {
$output = '<div class="copyright">'.__( 'Copyright &copy;', 'travelify' ).' '.'[the-year] [site-link]'.' '.__( 'Theme by', 'travelify' ).' '.'[th-link]'.'</div><!-- .copyright -->';
echo do_shortcode( $output );
}
@puikinsh
puikinsh / functions.min.js
Created April 6, 2014 06:56
Travelify slider function to stop slider at the end of slideshow
jQuery(window).load(function () {
var transition_effect = travelify_slider_value.transition_effect;
var transition_delay = travelify_slider_value.transition_delay;
var transition_duration = travelify_slider_value.transition_duration;
jQuery('.slider-cycle').cycle({
fx: transition_effect,
pager: '#controllers',
activePagerClass: 'active',
timeout: transition_delay,
speed: transition_duration,
@puikinsh
puikinsh / Menu CSS
Last active August 11, 2018 12:10
Change background color for menu items on hover and when active.
.navbar-default .navbar-nav > li > a, .navbar-default .navbar-nav > .open > a, .navbar-default .navbar-nav > .open > a:hover, .navbar-default .navbar-nav > .open > a:focus, .navbar-default .navbar-nav > .active > a, .navbar-default .navbar-nav > .active > a:hover, .navbar-default .navbar-nav > .active > a:focus {
background: #9C16A0;
color: #fff;
}
@puikinsh
puikinsh / Google Adsense for Sparkling
Created April 26, 2014 11:48
Sparkling Theme JavaScript edit to fix problem with responsive Google Adsense units
// Bootstrap specific functions and styling
// first set the body to hide and show everything when fully loaded
jQuery(document.body).hide();
jQuery(document).ready(function(){
jQuery(".comment-reply-link").addClass("btn btn-sm btn-default");
jQuery("#submit").addClass("btn btn-default");
jQuery(".wpcf7-submit").addClass("btn btn-default");
jQuery(".wp-caption").addClass("thumbnail");
@puikinsh
puikinsh / gist:304c2b66089dfdb3612e
Last active August 29, 2015 14:01
Sparkling Slider customizations
I will leave this code here to avoid encoding issues you might face when copying from Gmail
You can create flexslider customizations by creating a new file in child theme and enqueue it like this:
add_action( 'wp_enqueue_scripts', 'sparkling_child_script' );
function sparkling_child_script() {
wp_enqueue_script( 'sparkling_child_slider', get_stylesheet_directory_uri() . '/js/newflex.js', array( 'jquery' ), '2.2.2', true );
}
@puikinsh
puikinsh / gist:bb8075a4d620d9082eda
Created November 26, 2014 15:10
This is a very basic example with just one paragraph and a link to the stylesheet.
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="style.css" />
</head>
<body>
<p>
This is an amazing text because has a custom font.
</p>
</body>