gdfwilliams
Forum Replies Created
-
Forum: Plugins
In reply to: [Retro Game Emulator] Control Vertical Scrolling?Best way to deal with this turned out to be changing the controls for up/down and left/right. Instead of arrow keys, I use I/K, J/L respectively.
In /lib/apps.js:
switch(event.keyCode){ case 73: // UP callback(player, jsnes.Controller.BUTTON_UP); break; case 75: // Down callback(player, jsnes.Controller.BUTTON_DOWN); break; case 74: // Left callback(player, jsnes.Controller.BUTTON_LEFT); break; case 76: // Right callback(player, jsnes.Controller.BUTTON_RIGHT); break;And in /shortcode-template.php:
<tr> <td><?php echo __("Left"); ?></td> <td><?php echo __("J"); ?></td> <td><?php echo __("Num-4"); ?></td> <tr> <td><?php echo __("Right"); ?></td> <td><?php echo __("L"); ?></td> <td><?php echo __("Num-6"); ?></td> </tr> <tr> <td><?php echo __("Up"); ?></td> <td><?php echo __("I"); ?></td> <td><?php echo __("Num-8"); ?></td> </tr> <tr> <td><?php echo __("Down"); ?></td> <td><?php echo __("K"); ?></td> <td><?php echo __("Num-2"); ?></td> </tr>Isn’t this is fairly easy to deal with by using some custom functions to clean up the content prior to saving it? I have filters that modify subject lines, remove whole blocks of promotional text, clean up content, etc.
https://kb.wprssaggregator.com/article/297-f2p-filter-modify-imported-posts-before-they-are-savedForum: Plugins
In reply to: [Ultimate LinkedIn Integration] Redirect After LoginThe header.php change above should include an additional line to properly expire the cookie. Also, I was experiencing some issues with getting stuck on wp-login if that was my referring URL, so we push them to wp-admin and let WP decide what to do with them:
<?php if((isset($_COOKIE['li_redirect'])) && ($_GET['li']) && is_home()) { $li_redirect = $_COOKIE['li_redirect']; unset($_COOKIE['li_redirect']); setcookie('li_redirect', '', time() - ( 15 * 60 ) ); if (strpos($li_redirect, 'wp-login') !== false) { $li_redirect = admin_url(); } header("Location: ". $li_redirect); } ?>- This reply was modified 7 years ago by gdfwilliams.
Forum: Plugins
In reply to: [Ultimate LinkedIn Integration] Plugin no longer works with v2 and how to fixIs this issue specific to the Share button? (Seems to still be working for me.)
Forum: Plugins
In reply to: [Ultimate LinkedIn Integration] Abandoned Project? Website down!Works great for me. The documentation is here:
https://thoughtengineer.com/docs/ultimate-linkedin-login/Forum: Plugins
In reply to: [Co-Authors Plus] Custom fields in author.phpHere’s an example of a loop that will return featured image, some of the built-in fields, plus a custom field (named author_ad_bottom in this example).
<?php $coauthors = get_coauthors(); foreach( $coauthors as $coauthor ): echo "author URL: ". get_author_posts_url( $coauthor->ID, $coauthor->user_nicename ); echo "<br>thumbnail: ". get_the_post_thumbnail( $coauthor->ID, array(120,120), array('class' => 'avatar')); echo "<br>Display name:". get_post_meta($coauthor->ID, 'cap-display_name', true); echo "<br>website: ".$coauthor->website; echo "<br>description: ".$coauthor->description; echo "<br>custom field ". get_post_meta($coauthor->ID, 'author_ad_bottom', true); echo "<br><br>"; endforeach; ?>Forum: Plugins
In reply to: [Co-Authors Plus] Photo for the Guest AuthorTo do so, I have removed all the avatar calls that use the guest author email and instead use a featured image for each guest author. I call the featured image (and some of the other tags) like this:
<?php $coauthors = get_coauthors(); foreach( $coauthors as $coauthor ): echo "author URL: ". get_author_posts_url( $coauthor->ID, $coauthor->user_nicename ); echo "<br>thumbnail: ". get_the_post_thumbnail( $coauthor->ID, array(120,120), array('class' => 'avatar')); echo "<br>Display name:". get_post_meta($coauthor->ID, 'cap-display_name', true); echo "<br>website: ".$coauthor->website; echo "<br>description: ".$coauthor->description; echo "<br>custom field ". get_post_meta($coauthor->ID, 'author_ad_bottom', true); endforeach; ?>That last one is a custom field named “author_ad_bottom.” To enable custom fields for the guest-author post type, add this to your theme’s functions.php:
add_post_type_support( 'guest-author', 'custom-fields');The first code above is a foreach() loop, so it will run through that list for each assigned author. If you’re just using one author (I’m using this plugin to easily assign syndicated columnists as authors without needing separate user accounts), then skip the foreach() and just grab the first value in the #coauthors array like $coauthors[0]->ID.
This should be a good start. It worked well in other themes.
// About Author if(get_post_meta($post->ID, 'post-option-author-info-enabled', true) == "Yes"){ $coauthors = get_coauthors(); foreach( $coauthors as $coauthor ): echo "<div class='about-author-wrapper'>"; echo "<div class='about-author-avartar'><a href='". get_author_posts_url( $coauthor->ID, $coauthor->user_nicename )."'>". get_avatar($coauthor->user_email, 90, '', $coauthor->display_name) ."</a></div>"; echo "<div class='about-author-info'><div class='about-author-title gdl-link-title gdl-title'>". $coauthor->display_name ."</div>"; echo $coauthor->description; echo " View all posts by <a href='". get_author_posts_url( $coauthor->ID, $coauthor->user_nicename )."'>". $coauthor->display_name ."</a>."; echo "</div>"; echo "<div class='clear'></div>"; echo "</div>"; endforeach; }Forum: Plugins
In reply to: [Co-Authors Plus] changing loopI did this for an early version of this plugin, but it worked for me then:
// About Author if(get_post_meta($post->ID, 'post-option-author-info-enabled', true) == "Yes"){ $coauthors = get_coauthors(); foreach( $coauthors as $coauthor ): echo "<div class='about-author-wrapper'>"; echo "<div class='about-author-avartar'><a href='". get_author_posts_url( $coauthor->ID, $coauthor->user_nicename )."'>". get_avatar($coauthor->user_email, 90, '', $coauthor->display_name) ."</a></div>"; echo "<div class='about-author-info'><div class='about-author-title gdl-link-title gdl-title'>About ". $coauthor->display_name ."</div>"; echo $coauthor->description; echo " View all posts by <a href='". get_author_posts_url( $coauthor->ID, $coauthor->user_nicename )."'>". $coauthor->display_name ."</a>."; echo "</div>"; echo "<div class='clear'></div>"; echo "</div>"; endforeach; }Forum: Plugins
In reply to: [Co-Authors Plus] Theme integration issues for bio and custom avatarHappy to help, Daniel. Thanks again for all your hard work!
Forum: Plugins
In reply to: [Co-Authors Plus] Theme integration issues for bio and custom avatarAnd lastly, here it is with links to “All posts by Co-Author Name” links both in the description text and a link on the avatar:
// About Author if(get_post_meta($post->ID, 'post-option-author-info-enabled', true) == "Yes"){ $coauthors = get_coauthors(); foreach( $coauthors as $coauthor ): echo "<div class='about-author-wrapper'>"; echo "<div class='about-author-avartar'><a href='". get_author_posts_url( $coauthor->ID, $coauthor->user_nicename )."'>". get_avatar($coauthor->user_email, 90, '', $coauthor->display_name) ."</a></div>"; echo "<div class='about-author-info'><div class='about-author-title gdl-link-title gdl-title'>". $coauthor->display_name ."</div>"; echo $coauthor->description; echo " View all posts by <a href='". get_author_posts_url( $coauthor->ID, $coauthor->user_nicename )."'>". $coauthor->display_name ."</a>."; echo "</div>"; echo "<div class='clear'></div>"; echo "</div>"; endforeach; }Forum: Plugins
In reply to: [Co-Authors Plus] Theme integration issues for bio and custom avatarHere’s what I’ve ended up using:
// About Author if(get_post_meta($post->ID, 'post-option-author-info-enabled', true) == "Yes"){ $coauthors = get_coauthors(); foreach( $coauthors as $coauthor ): echo "<div class='about-author-wrapper'>"; echo "<div class='about-author-avartar'>". get_avatar($coauthor->user_email, 90) ."</div>"; echo "<div class='about-author-info'><div class='about-author-title gdl-link-title gdl-title'>". $coauthor->first_name ." ". $coauthor->last_name ."</div>"; echo $coauthor->description; echo "</div>"; echo "<div class='clear'></div>"; echo "</div>"; endforeach; }Forum: Plugins
In reply to: [Co-Authors Plus] Theme integration issues for bio and custom avatarRE: my post above, I have come to discover that my issue is particular to either my theme or PHP settings. If I hardcode an author email in the call below, it calls up the Guest Author’s featured image:
get_avatar(the_author_email(), 90 )Question: Can we call the image using anything other than email?
Thanks,
GDWForum: Plugins
In reply to: [Co-Authors Plus] Theme integration issues for bio and custom avatarjh, have you found a solution to this issue?
I am using the following to display author info, but like jh, this code wants to insert a gravatar for the co-authors, even if they don’t have an email defined:
// About Author if(get_post_meta($post->ID, 'post-option-author-info-enabled', true) == "Yes"){ $i = new CoAuthorsIterator(); while($i->iterate()){ echo "<div class='about-author-wrapper'>"; echo "<div class='about-author-avartar'>" . get_avatar( get_the_author_meta('ID'), 90 ) . "</div>"; echo "<div class='about-author-info'>"; echo "<div class='about-author-title gdl-link-title gdl-title'>"; echo the_author_firstname(); echo " "; echo the_author_lastname(); echo "</div>"; echo the_author_description(); echo " All posts by "; echo the_author_posts_link('namefl'); echo "</div>"; echo "<div class='clear'></div>"; echo "</div>"; } }Any ideas how I might show featured image if one is defined for Guest Author?
(Sorry if you’ve addressed this elsewhere, but there are a number of posts looking for similar functionality, but many of them prescribe a different course of action.)
Thanks, Daniel!
GDWForum: Plugins
In reply to: [Co-Authors Plus] Duplicate author/co-authors showing in postsThanks, Daniel!