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
# Please, enable "Multiverse" in /etc/apt/sources.list | |
# Add the AWS PPA - sudo apt-add-repository ppa:awstools-dev/awstools | |
# Update and then install - sudo apt-get update && sudo apt-get install ec2-api-tools | |
# Upload your AWS Credential (PEM files) | |
# Save this script in /etc/rc.local | |
export EC2_KEYPAIR=<name only-not the file name> | |
export EC2_URL=https://ec2.us-east-1.amazonaws.com | |
export EC2_PRIVATE_KEY=/var/opt/ec2/<pk-filename.pem> | |
export EC2_CERT=/var/opt/ec2/<cert-filename.pem> |
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
//* Add featured image in RSS feed | |
add_filter('the_content_feed', 'qr_rss_featured'); | |
function qr_rss_featured($content) { | |
global $post; | |
if( has_post_thumbnail($post->ID) ) | |
$content = ' ' . get_the_post_thumbnail($post->ID, 'thumbnail') . ' ' . $content; | |
return $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
// Remove WordPress Generator Meta Tag | |
function remove_generator_filter() { return ''; } | |
if (function_exists('add_filter')) { | |
$types = array('html', 'xhtml', 'atom', 'rss2', 'rdf', 'comment', 'export'); | |
foreach ($types as $type) | |
add_filter('get_the_generator_'.$type, 'remove_generator_filter'); | |
} | |
// Another option: | |
function qr_remove_wp_version() {return '';} |
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
//* Add last updated date to the post info in entry header (requires HTML5 theme support) | |
add_filter( 'genesis_post_info', 'qr_post_info_filter' ); | |
function qr_post_info_filter($post_info) { | |
if (get_the_modified_time() != get_the_time()) { | |
$post_info = $post_info . '<br/>Last updated on: ' . the_modified_date('j/m/Y', '', '', false); | |
} | |
return $post_info; | |
} |
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
<html lang="es-MX" xmlns:fb="http://ogp.me/ns/fb#" prefix="og: http://ogp.me/ns#"/> | |
<head> | |
<meta charset="UTF-8" /> | |
<meta name="viewport" content="width=device-width, initial-scale=1" /> | |
<title>Titulo de la página</title> | |
<meta name="description" content="Descripción de la página"/> | |
<link rel="canonical" href="http://mydomain.com/pagina" /> | |
<meta name="robots" content="index,follow" /> |
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
// Change schema.org markup | |
function qr_body_schema( $attr ) { | |
$attr['class'] = join( ' ', get_body_class() ); | |
$attr['itemscope'] = 'itemscope'; | |
$attr['itemtype'] = 'http://schema.org/Restaurant'; | |
return $attr; | |
} | |
add_filter( 'genesis_attr_body', 'qr_body_schema', 20 ); |
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
// Modify entry comments | |
function qr_admin_author($comment_data){ | |
if ($comment_data['comment_author_email'] == '[email protected]') { | |
$comment_data['user_ID'] = 1; | |
$comment_data['comment_author'] = 'Author Name'; | |
$comment_data['comment_author_url'] = 'Author URL'; | |
} | |
return $comment_data; | |
} | |
add_filter('preprocess_comment','qr_admin_author'); |
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
//* Modify header title-url depending on WP site language - HTML5 Version (Genesis Framework) | |
add_filter( 'genesis_seo_title', 'qr_header_title', 10, 3 ); | |
function qr_header_title( $title, $inside, $wrap ) { | |
// Default | |
$taitol = sprintf('<span class="custom-class">QR</span> %s', get_bloginfo( 'name' )); | |
$inside = sprintf( '<a href="https://qrokes.com/" title="%s">%s</a>', 'Inicio', $taitol ); | |
$currentlang = get_bloginfo('language'); | |
// English | |
if($currentlang=="en-US") { | |
$inside = sprintf( '<a href="https://qrokes.com/en/" title="%s">%s</a>', 'Home', $taitol ); |
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
/* Insert OpenSearch Code (Wordpress) */ | |
add_action( 'wp_head', 'qr_opensearch' ); | |
function qr_opensearch () { | |
echo '<link rel="search" type="application/opensearchdescription+xml" href="/wp-content/themes/qrokes/opensearch.xml" title="QROkes.com" />' . ""; | |
} |
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
// Add an element after "Home" to Yoast SEO breadcrumbs. (WordPress) | |
add_filter( 'wpseo_breadcrumb_links', 'qr_add_breadcrumb' ); | |
function qr_add_breadcrumb( $links ) { | |
$breadcrumb[] = array( | |
'url' => 'URL', | |
'text' => 'Text', | |
); | |
array_splice( $links, 1, -2, $breadcrumb ); | |
return $links; | |
} |
OlderNewer