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 / 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' ),
));
@anwerashif
anwerashif / functions.php
Created February 23, 2018 18:58
Customize Single Post Featured Image and Add Before Entry
<?php
// Do NOT include the PHP opening tag
// Register a custom image size for Singular Featured images
add_image_size( 'singular-featured-thumb', 800, 450, true );
// Display featured image before entry
add_action( 'genesis_before_entry', 'display_featured_image' );
function display_featured_image() {
if ( ! is_singular( array( 'post' ) ) ) {
@anwerashif
anwerashif / functions.php
Created February 23, 2018 18:24
Customize the footer section
<?php
// Do NOT include the PHP opening tag
// Customize the footer section
add_filter('genesis_footer_creds_text', 'bdfg_footer_creds_text');
function bdfg_footer_creds_text($creds) {
global $wpdb;
$table = $wpdb->prefix . 'posts';
$lastDate = date('Y');
$firstDate = $wpdb->get_var("SELECT YEAR(post_date) FROM $table ORDER BY post_date LIMIT 1");
@anwerashif
anwerashif / functions.php
Created February 22, 2018 20:22
Adding Content Before Your Posts
<?php
// Do NOT include PHP opening tag
// Adding Content Before Your Posts
function rs_content() {
if ( is_home( ) )
echo '<div class="before-blog"><h1 class="entry-title blog" itemprop="headline">Premier Publishing Resource</h1>Our Free Resource Helping You with Business Growth Hacking and Revamp WordPress Website</div>';
};
add_action('genesis_before_loop', 'rs_content');