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 / 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 );
@anwerashif
anwerashif / studio.js
Created March 19, 2018 20:15
How to Add Pinterest Button to Genesis Framework
$(document).ready(function(){
// Where PinMe.js should look for images (body, .post, #very-specific-element, etc.)
$(".content").pinMe({pinButton: '<i class="fa fa-pinterest fa-2x"></i>'});
});
@anwerashif
anwerashif / pinme.js
Created March 19, 2018 10:02
How to Add Pinterest Button to Genesis Framework
/**
* @author Eric Hermanson
*/
;(function($) {
'use strict';
$.fn.pinMe = function (options) {
@anwerashif
anwerashif / functions.php
Created February 23, 2018 21:08
Add Text or Link To Genesis Site Description
<?php
// Do NOT include the PHP opening tag
// Echo Phone Number to Site Description
function psi_phone_after_des() {
echo '<p class="phone-no"><a href="tel:206.322.3186">206.322.3186</a></p>';
}
@anwerashif
anwerashif / functions.php
Created February 23, 2018 20:30
Force Full-Width All Pages in Genesis Framework
<?php
// Do NOT include the PHP opening tag
// Full Width All Pages
function all_pages_full_width( $full ) {
if ( is_page( ) ) {
$full = 'full-width-content';
return $full;
}
}
@anwerashif
anwerashif / functions.php
Last active February 23, 2018 20:15
Add FontAwesome Icon to Search Form Input Button
<?php
// Do NOT add the PHP opening tag
// Add Icon Fonts to theme
add_action( 'wp_enqueue_scripts', 'rs_enqueue_styles' );
function rs_enqueue_styles() {
wp_enqueue_style( 'fa', '//maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css', array(), '4.5' );
}
@anwerashif
anwerashif / functions.php
Created February 23, 2018 19:56
Add Search Box to Genesis' Primary Menu
<?php
// Do NOT include the opening PHP tag
// Add search form to 'primary' menu
function theme_menu_extras( $menu, $args ) {
// Change 'primary' to 'secondary' to add extras to the secondary navigation menu
if ( 'primary' !== $args->theme_location )
return $menu;
// add a search form to the navigation menu
@anwerashif
anwerashif / functions.php
Created February 23, 2018 19:24
Register a Widget Area and Display After Content-Sidebar
<?php
// Do NOT the PHP opening tag
// Custom widget area for contact form
genesis_register_sidebar( array(
'id' => 'contact-before-footer',
'name' => __( 'Contact Before Footer', 'rainastudio' ),
'description' => __( 'Entry Contact Before Footer Content Widget', 'rainastudio' ),
));