Skip to content

Instantly share code, notes, and snippets.

View anwerashif's full-sized avatar
🚩
Coding

Anwer Ashif anwerashif

🚩
Coding
View GitHub Profile
@anwerashif
anwerashif / jumboshare.js
Last active May 9, 2018 11:36
Add Custom Social Share Buttons with Counter
/*
* JumboShare jQuery Social Share Buttons
* @package StudioPlayer
* @link https://github.com/mycodingtricks/jumboShare
*/
(function($){
$.fn.jumboShare = function( options ) {
var cssId = 'fontawesomeCss'; // you could encode the css path itself to generate id..
if (!document.getElementById(cssId))
{
@anwerashif
anwerashif / style.css
Created May 8, 2018 21:17
404 Page CSS in Genesis Framework
/* # 404 NOT FOUND page
---------------------------------------------------------------------------------------------------- */
.not-found .content, .not-found .content .entry {
background: transparent;
border-color: transparent;
}
.not-found .content {
margin: 7% auto 0;
}
@anwerashif
anwerashif / functions.php
Last active May 8, 2018 22:00
Register Custom Widget for 404 Not Found Page in Genesis
<?php
// Do NOT include the PHP opening tag.
// Register not-found-widget
genesis_register_sidebar( array(
'id' => 'not-found-widget',
'name' => __( '404 Page Widget', 'studio_player' ),
'description' => __( 'This is the widget area for 404 NOT FOUND page. It uses to add sign up form.', 'studio_player' ),
));
@anwerashif
anwerashif / 404.php
Last active May 8, 2018 21:27
Custom 404 Not Found Page in Genesis Framework
<?php
/**
* 404 NOT FOUND.
*
* @package StudioPlayer
* @link https://rainastudio.com/themes/studioplayer
* @author RainaStudio
* @copyright Copyright © 2018 RainaStudio
* @license GPL-2.0+
*/
@anwerashif
anwerashif / functions.php
Created April 26, 2018 05:44
Enqueue JS file to functions.php
<?php
// Do NOT include opening PHP tag.
// Enqueue 'sound.js'
add_action('wp_enqueue_scripts', 'sound_scripts');
function sound_scripts() {
wp_register_script( 'app-sound-js', get_stylesheet_directory_uri() .'/js/rainastudio.js', array( 'jquery' ), CHILD_THEME_VERSION, true );
wp_enqueue_script( 'app-sound-js' );
@anwerashif
anwerashif / sound.js
Created April 26, 2018 05:25
Pull audio file and play onclick
$(document).ready(function() {
var audioElement = document.createElement('audio');
audioElement.setAttribute('src', 'https://rainastudio.com/wp-content/themes/rainastudio/sound/rainastudio.mp3');
audioElement.autoPlay=false;
$('#soundPlay').click(function(e) {
audioElement.play();
// Cancel the default action
e.preventDefault();
@anwerashif
anwerashif / functions.php
Last active April 26, 2018 04:40
Install font awesome on WordPress + Genesis Framework
<?php
// Do NOT include opening tag.
// Enqueue Font Awesome.
add_action( 'wp_enqueue_scripts', 'your_site_font_awesome' );
function your_site_font_awesome() {
wp_enqueue_style( 'font-awesome', '//maxcdn.bootstrapcdn.com/font-awesome/latest/css/font-awesome.min.css' );
@anwerashif
anwerashif / functions.php
Created April 12, 2018 16:51
Prevent GoogleBot to Index Archive Pages on Your Blog
<?php
// Do NOT include opening tag
// add 'noindex' meta to archive
add_action( 'wp_head', 'add_noindex' );
function add_noindex() {
if(is_archive()) {
echo '<meta name="robots" content="noindex,follow" />';
}
@anwerashif
anwerashif / functions.php
Created March 19, 2018 20:20
How to Add Pinterest Button to Genesis Framework
<?php
// Do NOT include the PHP opening tag
// Enqueue Scripts
add_action( 'wp_enqueue_scripts', 'pinterest_button_script' );
function pinterest_button_script() {
wp_enqueue_script( 'pin-me-int', get_stylesheet_directory_uri() .'/js/pinme.js', array( 'jquery' ), CHILD_THEME_VERSION, true );
wp_enqueue_script( 'mystudio', get_stylesheet_directory_uri() .'/js/rainastudio.js', array( 'jquery' ), CHILD_THEME_VERSION, true );