This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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' ) ) ) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Do NOT include the opening PHP tag | |
// Customize the entry meta in the entry header | |
add_filter( 'genesis_post_info', 'bg_entry_meta_header' ); | |
function bg_entry_meta_header( $post_info ) { | |
// get author details | |
$entry_author = get_avatar( get_the_author_meta( 'user_email' ), 30 ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- breadcrumb --> | |
<div class="breadcrumb-wrap"> | |
<nav aria-label="breadcrumb"> | |
<?php get_breadcrumb(); ?> | |
</nav> | |
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Do NOT include the opening PHP tag | |
/** | |
* Generate breadcrumbs | |
*/ | |
function get_breadcrumb() { | |
echo '<ol class="breadcrumb">'; | |
if (!is_home()) { | |
echo '<li class="breadcrumb-item">You are here</li>'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Do NOT include the opening PHP tag | |
// Load Script | |
add_action( 'wp_enqueue_scripts', 'selected_option_js' ); | |
function selected_option_js() { | |
wp_register_script( 'sm-modal-script', get_template_directory_uri() . '/js/modal.js', array( 'jquery' ), '1.0.0', true ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jQuery( document ).ready(function(){ | |
// Add Modal HTML to body | |
jQuery('body').append( "<div id=\"myModal\" class=\"modal\"><span class=\"close\">×</span><img class=\"modal-content\" id=\"img01\"><div id=\"caption\"></div></div>"); | |
// Get the image and insert it inside the modal - use its "alt" text as a caption | |
jQuery(".img-frm img").on("click", function(){ // Change the class name ".img-frm img" with yours | |
var image = jQuery(this).attr("src"); | |
var captext = jQuery(this).attr("alt"); | |
jQuery(".modal").css("display","block"); | |
jQuery("#img01").attr("src", image); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Style the Image Used to Trigger the Modal */ | |
.img-frm img { /* Change the class name with yours */ | |
cursor: pointer; | |
transition: 0.3s; | |
} | |
.img-frm img:hover {opacity: 0.7;} /* Change the class name with yours */ | |
/* The Modal (background) */ | |
.modal { |