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('body_class','my_class_names'); | |
function my_class_names($classes) { | |
$classes[] = 'page-'.get_query_var('pagename'); | |
// return the $classes array | |
return $classes; | |
} |
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 replace_text_wps($text){ | |
$replace = array( | |
// 'WORD TO REPLACE' => 'REPLACE WORD WITH THIS' | |
'thesis' => '<a href="http://mysite.com/myafflink">thesis</a>', | |
'studiopress' => '<a href="http://mysite.com/myafflink">studiopress</a>' | |
); | |
$text = str_replace(array_keys($replace), $replace, $text); | |
return $text; |
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 | |
$parent_title = get_the_title($post->post_parent); | |
echo $parent_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 | |
add_filter( 'image_size_names_choose', 'custom_image_sizes_choose' ); | |
function custom_image_sizes_choose( $sizes ) { | |
$custom_sizes = array( | |
'featured-image' => 'Featured Image' | |
); | |
return array_merge( $sizes, $custom_sizes ); | |
} |
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 | |
// make category use parent category template | |
function load_cat_parent_template($template) { | |
$cat_ID = absint( get_query_var('cat') ); | |
$category = get_category( $cat_ID ); | |
$templates = array(); |
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_action( 'init', 'wpse17478_init' ); | |
function wpse17478_init() | |
{ | |
remove_filter( 'get_the_excerpt', 'wp_trim_excerpt' ); | |
} | |
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_action( 'admin_footer-post.php', 'wpse_22836_remove_top_categories_checkbox' ); | |
add_action( 'admin_footer-post-new.php', 'wpse_22836_remove_top_categories_checkbox' ); | |
function wpse_22836_remove_top_categories_checkbox() | |
{ | |
global $post_type; | |
if ( 'post' != $post_type ) |
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('attachment_fields_to_edit', 'estilo_legenda_edit', 10, 2); | |
add_filter('attachment_fields_to_save', 'estilo_legenda_save', 10, 2); | |
function estilo_legenda_edit($form_fields, $post) { | |
$value = get_post_meta($post->ID, '_captionstyle', true); | |
$form_fields['captionstyle'] = array( | |
'label' => __('Estilo da legenda'), | |
'input' => 'html', |
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, 'skills'); | |
if ( !is_wp_error($terms)) : ?> | |
<?php | |
$skills_links = wp_list_pluck($terms, 'name'); | |
$skills_yo = join(", ", $skills_links); | |
?> |
NewerOlder