Skip to content

Instantly share code, notes, and snippets.

<?php
//* Do NOT include the opening php tag
//* Display author box on single posts
add_filter( 'get_the_author_genesis_author_box_single', '__return_true' );
//* Modify the size of the Gravatar in the author box
add_filter( 'genesis_author_box_gravatar_size', 'author_box_gravatar_size' );
function author_box_gravatar_size( $size ) {
return '73';
/* Author Box
--------------------------------------------- */
.author-box .avatar {
height: 73px;
width: 73px;
border: 3px solid #fff;
border-radius: 5px;
float: none;
}
<?php
global $post;
$post_id = get_the_ID();
$permalink = get_permalink($post_id);
$title = htmlspecialchars_decode(esc_js(get_the_title()));
$api = gigya_get_option("api_key");
$comments = apply_filters("comments_plugin", "", array(
"post_id" => $post_id,
"permalink" => $permalink,
@elioverbey
elioverbey / limit-excerpt.php
Last active March 12, 2021 20:23
Wordpress Excerpt Limit
<?php
//Don't include the opening php tag
function eo_variable_length_excerpt($text, $length, $finish_sentence){
//Word length of the excerpt. This is exact or NOT depending on your '$finish_sentence' variable.
$length = 75; /* Change the Length of the excerpt. The Length is in words. */
//1 if you want to finish the sentence of the excerpt (No weird cuts).
$finish_sentence = 1; // Put 0 if you do NOT want to finish the sentence.
<?php
add_action( 'wp_enqueue_scripts', 'gigya_global_enqueue' );
function gigya_global_enqueue() {
$ss_url = $_ENV['secrets']['gigya_api_key'];
wp_enqueue_script( 'mysite-scripts', "https://cdns.gigya.com/JS/socialize.js?apiKey=$ss_url", array() );
}
?>
<?php
//* Hook in Gigya Sharebar
add_action( 'genesis_entry_content', 'gigya_share', 9 );
function gigya_share() {
if ( ! is_singular( 'post' ) )
return;
?>
<script type="text/javascript">
var act = new gigya.socialize.UserAction();
// Check if browser can handle SVG
if(!Modernizr.svg){
// Get all img tag of the document and create variables
var i=document.getElementsByTagName("img"),j,y;
// For each img tag
for(j = i.length ; j-- ; ){
y = i[j].src
// If filenames ends with SVG
if( y.match(/svg$/) ){
<?php
//* Excerpt Function: Limit and End on Sentence
function eo_variable_length_excerpt($text, $length, $finish_sentence){
//Word length of the excerpt. This is exact or NOT depending on your '$finish_sentence' variable.
$length = 75; /* Change the Length of the excerpt. The Length is in words. */
//1 if you want to finish the sentence of the excerpt (No weird cuts).
$finish_sentence = 1; // Put 0 if you do NOT want to finish the sentence.
<?php
require_once(__DIR__.'/gigya/GSSDK.php');
// Load comments as HTML string
$method = "comments.getStreamInfo";
$request = new GSRequest($_ENV['secrets']['gigya_api_key'],$_ENV['secrets']['gigya_secret_key'],$method);
$request->setParam("categoryID", "Jim Daly Blog");
$request->setParam("streamID", get_the_ID());
$response = $request->send();
print_r($response);
<?php
//* Hook in Gigya
add_action( 'genesis_entry_header', 'comment_count' );
function comment_count() {
if ( ! is_singular( 'post' ) )
return;
global $response;
?>