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
/** Fix header image aligment | |
add_theme_support( 'genesis-custom-header', array( 'width' => 396, 'height' => 120 ) ); | |
remove_action( 'wp_head', 'genesis_custom_header_style' ); | |
function qr_custom_header() { | |
$header_image = get_header_image(); | |
$output .= sprintf( '%s { background: url(%s) center no-repeat !important; }', genesis_html5() ? '.title-area' : '#header', esc_url( $header_image ) ); | |
printf( '<style type="text/css">%s</style>' . "\n", $output ); | |
} | |
add_action( 'wp_head','qr_custom_header' ); */ |
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
// Convert Unicode Escape Sequences to UTF-8. | |
$content = preg_replace_callback('/\\\\u([0-9a-fA-F]{4})/', function ($match) { | |
return mb_convert_encoding(pack('H*', $match[1]), 'UTF-8', 'UCS-2BE'); | |
}, $content); |
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 | |
// Full Width Landing Pages in Genesis | |
// http://www.billerickson.net/full-width-landing-pages-in-genesis/ | |
function qr_frontpage() { | |
// Insert custom sctruture/content instead of genesis() --> 'genesis_loop' | |
} | |
add_action( 'qr_content_area', 'qr_frontpage' ); |
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
// Add widget to the Primary Menu (Social Icons) | |
genesis_register_sidebar( array( | |
'id' => 'nav-social-menu', | |
'name' => __( 'Nav Social Menu', 'text-domain' ), | |
'description' => __( 'Primary menu widget for social icons.', 'text-domain' ), | |
) ); | |
add_filter( 'genesis_nav_items', 'qr_social_icons', 10, 2 ); | |
add_filter( 'wp_nav_menu_items', 'qr_social_icons', 10, 2 ); | |
function qr_social_icons($menu, $args) { |
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
// 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; | |
} |
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
/* 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 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
//* 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 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
// 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 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
// 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 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
<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" /> |