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 | |
$post = get_post($post_id); | |
$slug = $post->post_name; | |
?> |
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 | |
function dequeue_css() { | |
wp_dequeue_style('child-style'); | |
wp_deregister_style('child-style'); | |
} | |
add_action('wp_enqueue_scripts','dequeue_css',1002); | |
?> |
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 | |
function bold_first_word() { | |
$out = " | |
<script type=\"text/javascript\"> | |
jQuery('#content h1').html(function(i,html){ | |
return html.replace(/^\s*([^\s]+)(\s|$)/, '<span class=\"first-word\">$1 </span>'); | |
}); | |
</script> | |
"; | |
echo $out; |
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 | |
$terms = get_the_terms( $post->ID , 'types' ); // 'types' es el nombre de la taxonomia | |
if($terms) { | |
foreach( $terms as $term ) { | |
echo $term->name.'<br />'; | |
} | |
} | |
?> |
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_filter( 'get_the_archive_title', function ($title) { | |
if ( is_category() ) { | |
$title = single_cat_title( '', false ); | |
} elseif ( is_tag() ) { | |
$title = single_tag_title( '', false ); | |
} elseif ( is_author() ) { | |
$title = '<span class="vcard">' . get_the_author() . '</span>' ; | |
} | |
return $title; |
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 | |
$body_id = get_post_meta($post->ID,'body_id'); | |
?> | |
<body <?php body_class() ?> <?php if (!empty($body_id[0])) echo 'id="'.$body_id[0].'"' ?>> |
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_filter( 'wp_get_attachment_image_attributes', 'add_title_to_attachment_image', 10, 2 ); | |
function add_title_to_attachment_image( $attr, $attachment ) { | |
$attr['title'] = esc_attr( $attachment->post_title ); | |
return $attr; | |
} |
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 | |
// Based on Hide YouTube Related Videos plugin for WordPress | |
// Ocultar videos relacionados en youtube | |
add_filter('oembed_result', 'hide_youtube_related_videos', 10, 3); | |
function hide_youtube_related_videos($data, $url, $args = array()) { | |
//Setup the string to inject into the url | |
$str_to_add = apply_filters("hyrv_extra_querystring_parameters", "wmode=transparent&") . 'rel=0'; |
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 | |
/* | |
Reference @codex: | |
- Add menu: https://codex.wordpress.org/Function_Reference/add_menu_page | |
- Select icon: https://developer.wordpress.org/resource/dashicons/#menu | |
- Remove menu: https://codex.wordpress.org/Function_Reference/remove_menu_page | |
- Remove sub-menu: https://codex.wordpress.org/remove_submenu_page |
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 | |
/* | |
How to get the permalink for any content | |
- Reference: https://wpml.org/wpml-hook/wpml_element_link/ | |
- More hooks & examples at: https://wpml.org/documentation/support/wpml-coding-api/wpml-hooks-reference/#hook-605226 | |
*/ | |
// apply_filters( 'wpml_element_link', int $element_id, string $element_type, string $link_text, array $optional_parameters, string $anchor, bool $echo, bool $return_original_if_missing ) | |
apply_filters( 'wpml_element_link', 1, 'page'); |
OlderNewer