Created
June 7, 2012 23:55
-
-
Save jeremyboggs/2892485 to your computer and use it in GitHub Desktop.
custom coins
This file contains hidden or 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 | |
function my_custom_coins_title($coinsTitle) | |
{ | |
global $post; | |
$affiliation = get_post_meta($post->ID, 'affiliation', true); | |
$issue = get_post_meta($post->ID, 'issue', true); | |
$volume = get_post_meta($post->ID, 'volume', true); | |
$pub_date = get_post_meta($post->ID, 'pub_date', true); | |
$real_author_first = get_post_meta($post->ID, 'real_author_first', true); | |
$real_author_last = get_post_meta($post->ID, 'real_author_last', true); | |
// Starts the coins title value again. | |
$coinsTitle = 'ctx_ver=Z39.88-2004' | |
. '&rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Adc' | |
. '&rfr_id=info%3Asid%2Focoins.info%3Agenerator' | |
. '&rft.format=text' | |
. '&rft.jtitle='.urlencode(get_bloginfo('name')) | |
. '&rft.atitle='.urlencode($post->post_title) | |
. '&rft.source='.urlencode(get_bloginfo('name')) | |
. '&rft.date='.get_the_time('Y-m-d') | |
. '&rft.identifier='.urlencode(get_permalink($post->ID)) | |
. '&rft.language=English' | |
. '&rft.pub_date='.date('Y-m-d', strtotime($pub_date)) | |
. '&rft.issue='.urlencode($issue) | |
. '&rft.volume='.urlencode($volume) | |
. '&rft.aufirst='.urlencode($real_author_first) | |
. '&rft.aulast='.urlencode($real_author_last) | |
. '&rft.genre=article'; | |
if ($cats = get_the_category()) { | |
foreach((get_the_category()) as $cat) { | |
$coinsTitle .= '&rft.subject='.urlencode($cat->cat_name); | |
} | |
} | |
return $coinsTitle; | |
} | |
add_filter('scholarpress_coins_span_title', 'my_custom_coins_title'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment