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 | |
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, |
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 | |
//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. | |
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 | |
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() ); | |
} | |
?> |
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
// 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$/) ){ |
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 | |
//* 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. | |
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 | |
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); |
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 | |
//* Hook in Gigya | |
add_action( 'genesis_entry_header', 'comment_count' ); | |
function comment_count() { | |
if ( ! is_singular( 'post' ) ) | |
return; | |
global $response; | |
?> |