Skip to content

Instantly share code, notes, and snippets.

Avatar
🚩
Coding

Anwer Ashif anwerashif

🚩
Coding
View GitHub Profile
View menu-fields.php
<?php
$fields = array (
'field-01' => __( 'Icon URL', 'menu-item-custom-icon_field' ),
'field-02' => __( 'New Field', 'menu-item-custom-new_field' ),
);
// funtion to add fields to menu item
function add_menuset_c_fields( $id, $item, $depth, $args ) {
@anwerashif
anwerashif / front-page.php
Created May 17, 2018
Creating Custom Front Page Template Design for Blog in Genesis >> https://rainastudio.com/custom-front-page-template-design/
View front-page.php
<?php
/**
* Front Page.
*
* @package StudioPlayer
* @link https://rainastudio.com/themes/studioplayer
* @author RainaStudio
* @copyright Copyright © 2018 RainaStudio
* @license GPL-2.0+
*/
View related-posts.php
@anwerashif
anwerashif / jumboshare.js
Last active May 9, 2018
Add Custom Social Share Buttons with Counter
View jumboshare.js
/*
* 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
404 Page CSS in Genesis Framework
View style.css
/* # 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
Register Custom Widget for 404 Not Found Page in Genesis
View functions.php
<?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
Custom 404 Not Found Page in Genesis Framework
View 404.php
<?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 Apr 26, 2018
Enqueue JS file to functions.php
View 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 Apr 26, 2018
Pull audio file and play onclick
View sound.js
$(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 Apr 26, 2018
Install font awesome on WordPress + Genesis Framework
View functions.php
<?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' );